diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-02-04 00:44:07 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-02-04 00:44:07 +0100 |
commit | b8261a2378f84ffce6812cd5d35cfdb5aeb18918 (patch) | |
tree | 01c7b4963a204d10e724f436babfa4e5383ac64a /archaeological_operations/views.py | |
parent | ae6ddecdc6c9dc49488341a9c0d9a20282858e7b (diff) | |
download | Ishtar-b8261a2378f84ffce6812cd5d35cfdb5aeb18918.tar.bz2 Ishtar-b8261a2378f84ffce6812cd5d35cfdb5aeb18918.zip |
Reorganize searches for operations, files, administrativ acts
Diffstat (limited to 'archaeological_operations/views.py')
-rw-r--r-- | archaeological_operations/views.py | 78 |
1 files changed, 47 insertions, 31 deletions
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py index 9482f44b4..5299b7131 100644 --- a/archaeological_operations/views.py +++ b/archaeological_operations/views.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2016 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -132,26 +132,30 @@ get_operation = get_item( bool_fields=['end_date__isnull', 'virtual_operation'], dated_fields=['start_date__lte', 'start_date__gte', 'excavation_end_date__lte', 'excavation_end_date__gte'], - extra_request_keys={'common_name': 'common_name__icontains', - 'abstract': 'abstract__icontains', - 'end_date': 'end_date__isnull', - 'year_index': ('year', 'operation_code'), - 'start_before': 'start_date__lte', - 'start_after': 'start_date__gte', - 'end_before': 'excavation_end_date__lte', - 'end_after': 'excavation_end_date__gte', - 'towns__numero_insee__startswith': - 'towns__numero_insee__startswith', - 'parcel_0': ('parcels__section', - 'associated_file__parcels__section'), - 'parcel_1': ( - 'parcels__parcel_number', - 'associated_file__parcels__parcel_number'), - 'history_creator': - 'history_creator__ishtaruser__person__pk', - 'archaeological_sites': - 'archaeological_sites__pk', - }, + extra_request_keys={ + 'common_name': 'common_name__icontains', + 'comment': 'comment__icontains', + 'abstract': 'abstract__icontains', + 'end_date': 'end_date__isnull', + 'year_index': ('year', 'operation_code'), + 'start_before': 'start_date__lte', + 'start_after': 'start_date__gte', + 'end_before': 'excavation_end_date__lte', + 'end_after': 'excavation_end_date__gte', + 'towns__numero_insee__startswith': + 'towns__numero_insee__startswith', + 'parcel_0': ('parcels__section', + 'associated_file__parcels__section'), + 'parcel_1': ( + 'parcels__parcel_number', + 'associated_file__parcels__parcel_number'), + 'history_creator': + 'history_creator__ishtaruser__person__pk', + 'history_modifier': + 'history_modifier__ishtaruser__person__pk', + 'archaeological_sites': + 'archaeological_sites__pk', + }, ) show_operation = show_item(models.Operation, 'operation') revert_operation = revert_item(models.Operation) @@ -167,22 +171,34 @@ get_operationsource = get_item( 'comment': 'comment__icontains', 'additional_information': 'additional_information__icontains', 'operation__towns': 'operation__towns__pk', + 'operation__code_patriarche': 'operation__code_patriarche', 'operation__operation_type': 'operation__operation_type__pk', 'operation__year': 'operation__year'}) 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', - 'year': 'signature_date__year', - 'act_object': 'act_object__icontains', - 'history_creator': - 'history_creator__ishtaruser__person__pk', - 'operation__towns__numero_insee__startswith': - 'operation__towns__numero_insee__startswith' - }, + extra_request_keys={ + 'associated_file__towns': 'associated_file__towns__pk', + 'operation__towns': 'operation__towns__pk', + 'operation__code_patriarche': 'operation__code_patriarche', + 'act_type__intented_to': 'act_type__intented_to', + 'year': 'signature_date__year', + 'act_object': 'act_object__icontains', + 'history_creator': + 'history_creator__ishtaruser__person__pk', + 'history_modifier': + 'history_modifier__ishtaruser__person__pk', + 'operation__towns__numero_insee__startswith': + 'operation__towns__numero_insee__startswith', + 'indexed': 'index__isnull', + 'parcel_0': ('operation__parcels__section', + 'operation__associated_file__parcels__section'), + 'parcel_1': ( + 'operation__parcels__parcel_number', + 'operation__associated_file__parcels__parcel_number'), + }, + reversed_bool_fields=['index__isnull'], relative_session_names={'operation': 'operation__pk'}) get_administrativeact = get_item( |