diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-22 13:41:02 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-22 13:41:02 +0200 |
| commit | dafc5d16f3095bad00356b6198afcd5bbeab61d6 (patch) | |
| tree | 7040d1fd325ba67b890122059a8f50a3857e332a /archaeological_files | |
| parent | 64bb69c03ce1688c72b3f7ebd0e1550cd941aa69 (diff) | |
| parent | 0ecd905165193897129a71a1e8203232f0b2b68c (diff) | |
| download | Ishtar-dafc5d16f3095bad00356b6198afcd5bbeab61d6.tar.bz2 Ishtar-dafc5d16f3095bad00356b6198afcd5bbeab61d6.zip | |
Merge branch 'master' into v0.9
Diffstat (limited to 'archaeological_files')
| -rw-r--r-- | archaeological_files/locale/django.pot | 120 | ||||
| -rw-r--r-- | archaeological_files/models.py | 30 | ||||
| -rw-r--r-- | archaeological_files/views.py | 57 |
3 files changed, 89 insertions, 118 deletions
diff --git a/archaeological_files/locale/django.pot b/archaeological_files/locale/django.pot index 239526e90..c8e5b3952 100644 --- a/archaeological_files/locale/django.pot +++ b/archaeological_files/locale/django.pot @@ -9,11 +9,11 @@ msgid "" msgstr "" #: forms.py:52 forms.py:212 forms.py:257 forms.py:404 forms.py:431 -#: models.py:84 templates/ishtar/sheet_file.html:146 +#: models.py:108 templates/ishtar/sheet_file.html:146 msgid "Year" msgstr "" -#: forms.py:53 forms.py:217 forms.py:259 models.py:87 +#: forms.py:53 forms.py:217 forms.py:259 models.py:111 msgid "Numeric reference" msgstr "" @@ -25,7 +25,7 @@ msgstr "" msgid "Parcel (section/number/public domain)" msgstr "" -#: forms.py:60 forms.py:415 forms.py:442 models.py:519 +#: forms.py:60 forms.py:415 forms.py:442 models.py:543 msgid "Department" msgstr "" @@ -33,7 +33,7 @@ msgstr "" msgid "File name" msgstr "" -#: forms.py:62 forms.py:158 forms.py:223 models.py:95 +#: forms.py:62 forms.py:158 forms.py:223 models.py:119 msgid "File type" msgstr "" @@ -45,15 +45,15 @@ msgstr "" msgid "Saisine type" msgstr "" -#: forms.py:65 forms.py:311 models.py:60 models.py:126 +#: forms.py:65 forms.py:311 models.py:60 models.py:150 msgid "Permit type" msgstr "" -#: forms.py:67 forms.py:314 models.py:127 +#: forms.py:67 forms.py:314 models.py:151 msgid "Permit reference" msgstr "" -#: forms.py:68 forms.py:229 forms.py:372 models.py:156 +#: forms.py:68 forms.py:229 forms.py:372 models.py:180 #: templates/ishtar/sheet_file.html:99 msgid "Comment" msgstr "" @@ -62,7 +62,7 @@ msgstr "" msgid "In charge" msgstr "" -#: forms.py:77 forms.py:289 forms.py:453 models.py:102 +#: forms.py:77 forms.py:289 forms.py:453 models.py:126 msgid "General contractor" msgstr "" @@ -86,11 +86,11 @@ msgstr "" msgid "You should select a file." msgstr "" -#: forms.py:146 forms.py:221 models.py:135 +#: forms.py:146 forms.py:221 models.py:159 msgid "Creation date" msgstr "" -#: forms.py:147 forms.py:324 models.py:137 +#: forms.py:147 forms.py:324 models.py:161 msgid "Reception date" msgstr "" @@ -118,23 +118,23 @@ msgstr "" msgid "General" msgstr "" -#: forms.py:206 models.py:97 +#: forms.py:206 models.py:121 msgid "Person in charge" msgstr "" -#: forms.py:220 models.py:94 +#: forms.py:220 models.py:118 msgid "Name" msgstr "" -#: forms.py:225 models.py:139 +#: forms.py:225 models.py:163 msgid "Related file" msgstr "" -#: forms.py:233 models.py:147 +#: forms.py:233 models.py:171 msgid "Total surface (m2)" msgstr "" -#: forms.py:236 models.py:153 +#: forms.py:236 models.py:177 msgid "Main address" msgstr "" @@ -155,11 +155,11 @@ msgstr "" msgid "Preventive informations" msgstr "" -#: forms.py:301 models.py:114 +#: forms.py:301 models.py:138 msgid "Responsible for town planning service" msgstr "" -#: forms.py:317 models.py:150 +#: forms.py:317 models.py:174 msgid "Total developed surface (m2)" msgstr "" @@ -168,15 +168,15 @@ msgstr "" msgid "Research archaeology" msgstr "" -#: forms.py:348 models.py:159 templates/ishtar/sheet_file.html:90 +#: forms.py:348 models.py:183 templates/ishtar/sheet_file.html:90 msgid "Departments" msgstr "" -#: forms.py:359 models.py:168 +#: forms.py:359 models.py:192 msgid "Scientist in charge" msgstr "" -#: forms.py:361 models.py:162 templates/ishtar/sheet_file.html:92 +#: forms.py:361 models.py:186 templates/ishtar/sheet_file.html:92 msgid "Requested operation type" msgstr "" @@ -184,11 +184,11 @@ msgstr "" msgid "Lead organization" msgstr "" -#: forms.py:379 models.py:172 templates/ishtar/sheet_file.html:97 +#: forms.py:379 models.py:196 templates/ishtar/sheet_file.html:97 msgid "Classified area" msgstr "" -#: forms.py:381 models.py:174 templates/ishtar/sheet_file.html:98 +#: forms.py:381 models.py:198 templates/ishtar/sheet_file.html:98 msgid "Protected area" msgstr "" @@ -248,7 +248,7 @@ msgstr "" msgid "File permit reference" msgstr "" -#: ishtar_menu.py:33 models.py:196 templates/ishtar/sheet_file.html:4 +#: ishtar_menu.py:33 models.py:220 templates/ishtar/sheet_file.html:4 msgid "Archaeological file" msgstr "" @@ -292,7 +292,7 @@ msgstr "" msgid "General informations" msgstr "" -#: ishtar_menu.py:87 models.py:197 +#: ishtar_menu.py:87 models.py:221 #: templates/ishtar/dashboards/dashboard_file.html:7 msgid "Archaeological files" msgstr "" @@ -313,147 +313,147 @@ msgstr "" msgid "Delay (in days)" msgstr "" -#: models.py:88 +#: models.py:112 msgid "Internal reference" msgstr "" -#: models.py:90 +#: models.py:114 msgid "External ID" msgstr "" -#: models.py:93 +#: models.py:117 msgid "External ID is set automatically" msgstr "" -#: models.py:105 +#: models.py:129 msgid "General contractor (raw)" msgstr "" -#: models.py:109 +#: models.py:133 msgid "General contractor organization" msgstr "" -#: models.py:117 +#: models.py:141 msgid "Town planning service (raw)" msgstr "" -#: models.py:123 +#: models.py:147 msgid "Town planning service organization" msgstr "" -#: models.py:129 +#: models.py:153 msgid "Closing date" msgstr "" -#: models.py:130 +#: models.py:154 msgid "Town" msgstr "" -#: models.py:132 +#: models.py:156 msgid "Towns" msgstr "" -#: models.py:145 +#: models.py:169 msgid "Instruction deadline" msgstr "" -#: models.py:151 +#: models.py:175 msgid "Locality" msgstr "" -#: models.py:154 +#: models.py:178 msgid "Main address - postal code" msgstr "" -#: models.py:164 templates/ishtar/sheet_file.html:93 +#: models.py:188 templates/ishtar/sheet_file.html:93 msgid "Organization" msgstr "" -#: models.py:169 +#: models.py:193 msgid "Research archaeology comment" msgstr "" -#: models.py:183 +#: models.py:207 msgid "Cached name" msgstr "" -#: models.py:184 +#: models.py:208 msgid "Imported line" msgstr "" -#: models.py:199 +#: models.py:223 msgid "Can view all Archaelogical files" msgstr "" -#: models.py:200 +#: models.py:224 msgid "Can view own Archaelogical file" msgstr "" -#: models.py:201 +#: models.py:225 msgid "Can add own Archaelogical file" msgstr "" -#: models.py:203 +#: models.py:227 msgid "Can change own Archaelogical file" msgstr "" -#: models.py:205 +#: models.py:229 msgid "Can delete own Archaelogical file" msgstr "" -#: models.py:206 +#: models.py:230 msgid "Can close File" msgstr "" -#: models.py:212 +#: models.py:236 msgid "FILE" msgstr "" -#: models.py:380 +#: models.py:404 msgid "Multi-town" msgstr "" -#: models.py:386 +#: models.py:410 msgid "No town" msgstr "" -#: models.py:518 +#: models.py:542 msgid "File" msgstr "" -#: views.py:160 +#: views.py:107 msgid "File search" msgstr "" -#: views.py:169 +#: views.py:116 msgid "New file" msgstr "" -#: views.py:188 +#: views.py:135 msgid "File modification" msgstr "" -#: views.py:211 +#: views.py:158 msgid "File closing" msgstr "" -#: views.py:216 +#: views.py:163 msgid "File deletion" msgstr "" -#: views.py:223 +#: views.py:170 msgid "File: search administrative act" msgstr "" -#: views.py:232 +#: views.py:179 msgid "File: new administrative act" msgstr "" -#: views.py:242 +#: views.py:189 msgid "File: administrative act modification" msgstr "" -#: views.py:266 +#: views.py:213 msgid "File: administrative act deletion" msgstr "" 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( diff --git a/archaeological_files/views.py b/archaeological_files/views.py index a8053214f..0b05ad37d 100644 --- a/archaeological_files/views.py +++ b/archaeological_files/views.py @@ -28,7 +28,6 @@ from django.utils.translation import ugettext_lazy as _ from ishtar_common.views import get_item, show_item, revert_item -from ishtar_common.models import Person from archaeological_operations.models import Operation import models @@ -77,28 +76,7 @@ def autocomplete_file(request): for file in files]) return HttpResponse(data, mimetype='text/plain') -get_file = get_item( - models.File, 'get_file', 'file', - 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', - },) +get_file = get_item(models.File, 'get_file', 'file') revert_file = revert_item(models.File) @@ -113,38 +91,7 @@ show_file = show_item(models.File, 'file', extra_dct=extra_file_dct) get_administrativeactfile = get_item( AdministrativeAct, 'get_administrativeactfile', 'administrativeactfile', - associated_models=[ - (models.File, 'associated_file'), - (Person, 'associated_file__general_contractor')], - dated_fields=['signature_date__lte', 'signature_date__gte'], - extra_request_keys={ - 'year': 'signature_date__year', - 'associated_file__towns': 'associated_file__towns__pk', - 'history_creator': 'history_creator__ishtaruser__person__pk', - 'associated_file__operations__code_patriarche': - 'associated_file__operations__code_patriarche', - 'act_type__intented_to': 'act_type__intented_to', - 'act_object': 'act_object__icontains', - 'signature_date_before': 'signature_date__lte', - 'signature_date_after': 'signature_date__gte', - 'associated_file__general_contractor__attached_to': - 'associated_file__general_contractor__attached_to__pk', - 'associated_file__name': 'associated_file__name__icontains', - 'associated_file__towns__numero_insee__startswith': - 'associated_file__towns__numero_insee__startswith', - 'indexed': 'index__isnull', - 'parcel_0': ('operation__parcels__section', - 'associated_file__parcels__section'), - 'parcel_1': ( - 'operation__parcels__parcel_number', - 'associated_file__parcels__parcel_number'), - 'parcel_2': ('operations__parcels__public_domain', - 'associated_file__parcels__public_domain'), - 'associated_file__permit_reference': - 'associated_file__permit_reference__icontains'}, - reversed_bool_fields=['index__isnull'], - base_request={"associated_file__pk__isnull": False}, - relative_session_names=[('file', 'associated_file__pk')]) + base_request={"associated_file__pk__isnull": False}) def dashboard_file(request, *args, **kwargs): |
