diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-01-28 16:32:14 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-01-28 16:32:14 +0100 | 
| commit | 9f9afced817b6f663d4edc8856556b55b2e294b6 (patch) | |
| tree | b1de8aaa740768efcf6b8b1b878da1fbd87a9baf /archaeological_operations/forms.py | |
| parent | 9db260f9ac48b885edc02f2ec1c4ad3269a4c0f8 (diff) | |
| download | Ishtar-9f9afced817b6f663d4edc8856556b55b2e294b6.tar.bz2 Ishtar-9f9afced817b6f663d4edc8856556b55b2e294b6.zip | |
Change management of default departments - department searches for acts
Diffstat (limited to 'archaeological_operations/forms.py')
| -rw-r--r-- | archaeological_operations/forms.py | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 294e3163c..d696f44dc 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -418,6 +418,9 @@ class OperationSelect(TableSelect):      if settings.COUNTRY == 'fr':          code_patriarche = forms.IntegerField(label="Code PATRIARCHE")      towns = get_town_field() +    if settings.ISHTAR_DPTS: +        towns__numero_insee__startswith = forms.ChoiceField( +            label="Department", choices=[])      operation_type = forms.ChoiceField(label=_(u"Operation type"),                                         choices=[])      scientist = forms.IntegerField( @@ -484,6 +487,10 @@ class OperationSelect(TableSelect):          self.fields['periods'].help_text = models.Period.get_help()          self.fields['record_quality'].choices = \              [('', '--')] + list(models.QUALITY) +        if settings.ISHTAR_DPTS: +            k = 'towns__numero_insee__startswith' +            self.fields[k].choices = [ +                ('', '--')] + list(settings.ISHTAR_DPTS)          self.fields['relation_types'].choices = models.RelationType.get_types(              empty_first=False) @@ -1076,8 +1083,7 @@ class AdministrativeActOpeSelect(TableSelect):          if settings.ISHTAR_DPTS:              k = 'operation__towns__numero_insee__startswith'              self.fields[k].choices = [ -                ('', '--')] + [(str(dpt), str(dpt)) -                               for dpt in settings.ISHTAR_DPTS] +                ('', '--')] + list(settings.ISHTAR_DPTS)  class AdministrativeActOpeFormSelection(forms.Form): | 
