diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-09-05 10:41:24 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-24 12:06:08 +0200 |
commit | c5e794a0f21d5ebd8db764ae34d8026cf5caf365 (patch) | |
tree | 63a7d4c8f7cb34c6f4c0c9089bfafce00a46dfd8 /ishtar_common/forms.py | |
parent | 8d6714d0c71137b5b6f05723e9b336f67e10ee09 (diff) | |
download | Ishtar-c5e794a0f21d5ebd8db764ae34d8026cf5caf365.tar.bz2 Ishtar-c5e794a0f21d5ebd8db764ae34d8026cf5caf365.zip |
Quick actions: generic urls, views and forms
Diffstat (limited to 'ishtar_common/forms.py')
-rw-r--r-- | ishtar_common/forms.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 3dfcad09e..4300e9c36 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -640,6 +640,21 @@ class ManageOldType(IshtarForm): self.fields[field.key].help_text = field.get_help() +class QAForm(CustomForm, ManageOldType): + MULTI = False + + def __init__(self, *args, **kwargs): + self.items = kwargs.pop('items') + super(QAForm, self).__init__(*args, **kwargs) + for k in self.fields: + if self.MULTI and k not in self.REPLACE_FIELDS: + self.fields[k].label = unicode(self.fields[k].label) + \ + unicode(u" - append to existing") + else: + self.fields[k].label = unicode(self.fields[k].label) + \ + unicode(u" - replace") + + class DocumentGenerationForm(forms.Form): """ Form to generate document by choosing the template |