summaryrefslogtreecommitdiff
path: root/archaeological_operations/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/views.py')
-rw-r--r--archaeological_operations/views.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py
index d9baa4b7a..55e2b2692 100644
--- a/archaeological_operations/views.py
+++ b/archaeological_operations/views.py
@@ -102,12 +102,20 @@ def autocomplete_operation(request, non_closed=True):
q = request.GET.get('term')
query = Q()
for q in q.split(' '):
- extra = Q(towns__name__icontains=q)
+ extra = Q(towns__name__icontains=q) | Q(common_name__icontains=q)
try:
int(q)
extra = extra | Q(year=q) | Q(operation_code=q)
except ValueError:
pass
+ if settings.COUNTRY == 'fr':
+ if q.startswith('OA'):
+ q = q[2:]
+ try:
+ int(q)
+ extra = extra | Q(code_patriarche__contains=q)
+ except ValueError:
+ pass
query = query & extra
if non_closed:
query = query & Q(end_date__isnull=True)
@@ -150,6 +158,9 @@ get_operation = get_item(
'parcel_1': (
'parcels__parcel_number',
'associated_file__parcels__parcel_number'),
+ 'parcel_2': (
+ 'parcels__public_domain',
+ 'associated_file__parcels__public_domain'),
'history_creator':
'history_creator__ishtaruser__person__pk',
'history_modifier':
@@ -171,7 +182,9 @@ get_operationsource = get_item(
'description': 'description__icontains',
'comment': 'comment__icontains',
'additional_information': 'additional_information__icontains',
+ 'person': 'authors__person__pk',
'operation__towns': 'operation__towns__pk',
+ 'operation__operation_code': 'operation__operation_code',
'operation__code_patriarche': 'operation__code_patriarche',
'operation__operation_type': 'operation__operation_type__pk',
'operation__year': 'operation__year'})
@@ -198,6 +211,9 @@ get_administrativeactop = get_item(
'parcel_1': (
'operation__parcels__parcel_number',
'operation__associated_file__parcels__parcel_number'),
+ 'parcel_2': (
+ 'operation__parcels__public_domain',
+ 'operation__associated_file__parcels__public_domain'),
},
reversed_bool_fields=['index__isnull'],
relative_session_names={'operation': 'operation__pk'})
@@ -329,10 +345,13 @@ def operation_add(request, file_id):
return redirect(reverse('operation_creation',
kwargs={'step': 'general-operation_creation'}))
-operation_closing_wizard = OperationClosingWizard.as_view([
+operation_closing_steps = [
('selec-operation_closing', OperationFormSelection),
('date-operation_closing', ClosingDateFormSelection),
- ('final-operation_closing', FinalOperationClosingForm)],
+ ('final-operation_closing', FinalOperationClosingForm)]
+
+operation_closing_wizard = OperationClosingWizard.as_view(
+ operation_closing_steps,
label=_(u"Operation closing"),
url_name='operation_closing',)