summaryrefslogtreecommitdiff
path: root/archaeological_operations
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
commit99c8984ef19e524c0b0a419a17f0e9c0732b0138 (patch)
tree162945d752cf37ae82c874b6b4fba0ae804ad0f5 /archaeological_operations
parentf3cb91ccbaf0c90f74e99fffb8e2122bd1d0db0e (diff)
downloadIshtar-99c8984ef19e524c0b0a419a17f0e9c0732b0138.tar.bz2
Ishtar-99c8984ef19e524c0b0a419a17f0e9c0732b0138.zip
Improve administrativ act search (refs #1624)
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/forms.py14
-rw-r--r--archaeological_operations/views.py6
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):