diff options
Diffstat (limited to 'archaeological_operations')
| -rw-r--r-- | archaeological_operations/forms.py | 14 | ||||
| -rw-r--r-- | archaeological_operations/views.py | 6 |
2 files changed, 13 insertions, 7 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 7d7b79d63..bcdd44cf6 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -589,8 +589,13 @@ OperationSourceFormSelection = get_form_selection( ################################################ class AdministrativeActOpeSelect(TableSelect): - operation__towns = get_town_field() + year = forms.IntegerField(label=_("Year")) + index = forms.IntegerField(label=_("Index")) + if settings.COUNTRY == 'fr': + ref_sra = forms.CharField(label=u"Référence SRA", + max_length=15) act_type = forms.ChoiceField(label=_("Act type"), choices=[]) + operation__towns = get_town_field() def __init__(self, *args, **kwargs): super(AdministrativeActOpeSelect, self).__init__(*args, **kwargs) @@ -682,13 +687,12 @@ class GenerateDocForm(forms.Form): self.fields['doc_generation'].choices = [('', u'-'*9)] + \ [(choice.pk , unicode(choice)) for choice in choices] -class AdministrativeActRegisterSelect(TableSelect): - signature_date__year = forms.IntegerField(label=_(u"Year")) - act_type = forms.ChoiceField(label=_("Act type"), choices=[]) +class AdministrativeActRegisterSelect(AdministrativeActOpeSelect): def __init__(self, *args, **kwargs): super(AdministrativeActRegisterSelect, self).__init__(*args, **kwargs) - self.fields['act_type'].choices = models.ActType.get_types() + self.fields['act_type'].choices = models.ActType.get_types( + dct={'indexed':True}) self.fields['act_type'].help_text = models.ActType.get_help() class AdministrativeActRegisterFormSelection(forms.Form): diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 7e5a64ab4..a957fe8c1 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -148,12 +148,14 @@ get_administrativeactop = get_item(models.AdministrativeAct, 'get_administrativeactop', 'administrativeactop', extra_request_keys={'associated_file__towns':'associated_file__towns__pk', 'operation__towns':'operation__towns__pk', - 'act_type__intented_to':'act_type__intented_to'}, + 'act_type__intented_to':'act_type__intented_to', + 'year':'signature_date__year', + }, relative_session_names={'operation':'operation__pk'}) get_administrativeact = get_item(models.AdministrativeAct, 'get_administrativeact', 'administrativeact', - extra_request_keys={}) + extra_request_keys={'year':'signature_date__year',}) show_administrativeact = show_item(models.AdministrativeAct, 'administrativeact') def dashboard_operation(request, *args, **kwargs): |
