diff options
Diffstat (limited to 'archaeological_context_records/views.py')
-rw-r--r-- | archaeological_context_records/views.py | 51 |
1 files changed, 3 insertions, 48 deletions
diff --git a/archaeological_context_records/views.py b/archaeological_context_records/views.py index 0ced39b20..8991e4edd 100644 --- a/archaeological_context_records/views.py +++ b/archaeological_context_records/views.py @@ -35,20 +35,6 @@ import models show_contextrecord = show_item(models.ContextRecord, 'contextrecord') revert_contextrecord = revert_item(models.ContextRecord) -contextrecord_extra_keys = { - 'parcel__town': 'parcel__town__pk', - 'operation__year': 'operation__year__contains', - 'operation__code_patriarche': 'operation__code_patriarche', - 'operation__operation_code': 'operation__operation_code', - 'datings__period': 'datings__period__pk', - 'parcel_0': 'operation__parcels__section', - 'parcel_1': 'operation__parcels__parcel_number', - 'parcel_2': 'operation__parcels__public_domain', - 'label': 'label__icontains', - 'archaeological_sites': 'operation__archaeological_sites__pk', - 'cached_label': 'cached_label__icontains', -} - def autocomplete_contextrecord(request): if (not request.user.has_perm( @@ -80,16 +66,10 @@ def autocomplete_contextrecord(request): get_contextrecord = get_item( models.ContextRecord, - 'get_contextrecord', 'contextrecord', - relation_types_prefix={'ope_relation_types': 'operation__'}, - relative_session_names=[ - ('operation', 'operation__pk'), - ('file', 'operation__associated_file__pk')], - extra_request_keys=contextrecord_extra_keys,) + 'get_contextrecord', 'contextrecord') get_contextrecord_for_ope = get_item( models.ContextRecord, 'get_contextrecord', 'contextrecord', - extra_request_keys=contextrecord_extra_keys, own_table_cols=models.ContextRecord.TABLE_COLS_FOR_OPE) show_contextrecordsource = show_item(models.ContextRecordSource, @@ -97,36 +77,11 @@ show_contextrecordsource = show_item(models.ContextRecordSource, get_contextrecordsource = get_item( models.ContextRecordSource, - 'get_contextrecordsource', 'contextrecordsource', - relative_session_names=[ - ('contextrecord', 'context_record__pk'), - ('operation', 'context_record__operation__pk'), - ('file', 'context_record__operation__associated_file__pk')], - bool_fields=['duplicate'], - extra_request_keys={ - 'title': 'title__icontains', - 'description': 'description__icontains', - 'comment': 'comment__icontains', - 'person': 'authors__person__pk', - 'additional_information': 'additional_information__icontains', - 'context_record__parcel__town': 'context_record__parcel__town__pk', - 'context_record__operation__year': 'context_record__operation__year', - 'context_record__operation__operation_code': - 'context_record__operation__operation_code', - 'context_record__operation__code_patriarche': - 'context_record__operation__code_patriarche', - 'context_record__operation': 'context_record__operation__pk', - 'context_record__datings__period': - 'context_record__datings__period__pk', - 'context_record__unit': 'context_record__unit__pk', - }) + 'get_contextrecordsource', 'contextrecordsource') get_contextrecordrelation = get_item( models.RecordRelations, 'get_contextrecordrelation', - 'contextrecordrelation', - extra_request_keys={ - "left_record__operation": "left_record__operation__pk" - }) + 'contextrecordrelation') record_search_wizard = SearchWizard.as_view([ ('general-record_search', RecordFormSelection)], |