summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-12-17 01:53:53 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-12-17 01:53:53 +0100
commit758ee42b4970372d38d620f80c51854abc64a69f (patch)
tree10b2770b19fde76764d3a028fd01ae3ebe8176f5 /archaeological_operations/forms.py
parent7a8588afd998504e4fabf9614d03054b424fe3e7 (diff)
downloadIshtar-758ee42b4970372d38d620f80c51854abc64a69f.tar.bz2
Ishtar-758ee42b4970372d38d620f80c51854abc64a69f.zip
Choose document to generate at the end of create/modif process
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r--archaeological_operations/forms.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index 955b2f825..0cef41125 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -615,5 +615,12 @@ class FinalAdministrativeActDeleteForm(FinalForm):
class GenerateDocForm(forms.Form):
form_label = _("Doc generation")
- doc_generation = forms.BooleanField(required=False,
+ doc_generation = forms.ChoiceField(required=False, choices=[],
label=_(u"Generate the associated doc?"))
+ def __init__(self, *args, **kwargs):
+ choices = []
+ if 'choices' in kwargs:
+ choices = kwargs.pop('choices')
+ super(GenerateDocForm, self).__init__(*args, **kwargs)
+ self.fields['doc_generation'].choices = [('', u'-'*9)] + \
+ [(choice.pk , unicode(choice)) for choice in choices]