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
commitd8590171c727a9bd3cc3deca0fc8189f1da53227 (patch)
tree10b2770b19fde76764d3a028fd01ae3ebe8176f5 /archaeological_operations/forms.py
parent2789ba690ffc72c17f47a1c705edd28c5cb72cd7 (diff)
downloadIshtar-d8590171c727a9bd3cc3deca0fc8189f1da53227.tar.bz2
Ishtar-d8590171c727a9bd3cc3deca0fc8189f1da53227.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]