diff options
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 9 |
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] |