diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-21 11:12:47 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-21 11:12:47 +0200 |
commit | 9ea950ef761260d2b4e1706b6b76a57f67d93461 (patch) | |
tree | 2b16e28b04695fa01e1fee0fad14c66cfbe6a526 /archaeological_files/models.py | |
parent | b991654ccd2fb62d6ed2aa6e34e5774a5b11cb63 (diff) | |
download | Ishtar-9ea950ef761260d2b4e1706b6b76a57f67d93461.tar.bz2 Ishtar-9ea950ef761260d2b4e1706b6b76a57f67d93461.zip |
Manage export with importer's templates (refs #3064)
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r-- | archaeological_files/models.py | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 3721e4d3d..623eb1dee 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2012-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 @@ -77,10 +77,34 @@ if settings.COUNTRY == 'fr': class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem, DashboardFormItem): + SLUG = 'file' + SHOW_URL = 'show-file' TABLE_COLS = ['numeric_reference', 'year', 'internal_reference', 'file_type', 'saisine_type', 'towns', ] - SHOW_URL = 'show-file' - SLUG = 'file' + + # search parameters + BOOL_FIELDS = ['end_date__isnull'] + EXTRA_REQUEST_KEYS = { + 'parcel_0': ('parcels__section', + 'operations__parcels__section'), + 'parcel_1': ('parcels__parcel_number', + 'operations__parcels__parcel_number'), + 'parcel_2': ('operations__parcels__public_domain', + 'parcels__public_domain'), + 'end_date': 'end_date__isnull', + 'towns__numero_insee__startswith': + 'towns__numero_insee__startswith', + 'name': 'name__icontains', + 'cached_label': 'cached_label__icontains', + 'comment': 'comment__icontains', + 'permit_reference': 'permit_reference__icontains', + 'general_contractor__attached_to': + 'general_contractor__attached_to__pk', + 'history_creator': 'history_creator__ishtaruser__person__pk', + 'history_modifier': 'history_modifier__ishtaruser__person__pk', + } + + # fields year = models.IntegerField(_(u"Year"), default=lambda: datetime.datetime.now().year) numeric_reference = models.IntegerField( |