summaryrefslogtreecommitdiff
path: root/ishtar_common/forms.py
diff options
context:
space:
mode:
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
commit40c94fba1a9e3e119af8738f75f1e8082feb0c8b (patch)
tree63a7d4c8f7cb34c6f4c0c9089bfafce00a46dfd8 /ishtar_common/forms.py
parente5568da593a5bc13ab2065ec22a2d6b035be756b (diff)
downloadIshtar-40c94fba1a9e3e119af8738f75f1e8082feb0c8b.tar.bz2
Ishtar-40c94fba1a9e3e119af8738f75f1e8082feb0c8b.zip
Quick actions: generic urls, views and forms
Diffstat (limited to 'ishtar_common/forms.py')
-rw-r--r--ishtar_common/forms.py15
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