diff options
Diffstat (limited to 'archaeological_files/forms.py')
| -rw-r--r-- | archaeological_files/forms.py | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py index dbbbafbd9..68a004e4f 100644 --- a/archaeological_files/forms.py +++ b/archaeological_files/forms.py @@ -122,13 +122,15 @@ class FileFormSelection(forms.Form):              raise forms.ValidationError(_(u"You should select a file."))          return cleaned_data -SLICING = (('year',_(u"years")), ("month",_(u"months"))) +SLICING = (("month",_(u"months")), ('year',_(u"years")),)  DATE_SOURCE = (('creation',_(u"Creation date")),                 ("reception",_(u"Reception date")))  class DashboardForm(forms.Form):      slicing = forms.ChoiceField(label=_("Slicing"), choices=SLICING,                                required=False) +    department_detail = forms.BooleanField(label=_("Department detail"), +                              required=False)      date_source = forms.ChoiceField(label=_("Date get from"),                              choices=DATE_SOURCE, required=False)      file_type = forms.ChoiceField(label=_("File type"), choices=[], @@ -145,6 +147,10 @@ class DashboardForm(forms.Form):          self.fields['saisine_type'].choices = models.SaisineType.get_types()          self.fields['file_type'].choices = models.FileType.get_types() +    def get_show_detail(self): +        return hasattr(self, 'cleaned_data') and \ +           self.cleaned_data.get('department_detail') +      def get_date_source(self):          date_source = 'creation'          if hasattr(self, 'cleaned_data') and \ | 
