summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2014-01-17 14:28:41 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2014-01-17 14:28:41 +0100
commitb787f819a120cbc154867cb9ee02e5650b93e504 (patch)
tree162945d752cf37ae82c874b6b4fba0ae804ad0f5 /archaeological_operations/forms.py
parente27550b8a4bed0dd60c34f6bc554a7be7fd88e10 (diff)
downloadIshtar-b787f819a120cbc154867cb9ee02e5650b93e504.tar.bz2
Ishtar-b787f819a120cbc154867cb9ee02e5650b93e504.zip
Improve administrativ act search (refs #1624)
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r--archaeological_operations/forms.py14
1 files changed, 9 insertions, 5 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):