From 04fed929817936981dc3031379a4e8fbd13fb8f4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 14 Nov 2016 17:16:30 +0100 Subject: Update translations files --- archaeological_operations/locale/django.pot | 270 ++++++++++++++-------------- 1 file changed, 135 insertions(+), 135 deletions(-) (limited to 'archaeological_operations') diff --git a/archaeological_operations/locale/django.pot b/archaeological_operations/locale/django.pot index 0e55c760b..d20ceba2d 100644 --- a/archaeological_operations/locale/django.pot +++ b/archaeological_operations/locale/django.pot @@ -8,13 +8,13 @@ msgid "" msgstr "" -#: forms.py:67 forms.py:369 forms.py:1004 forms.py:1026 forms.py:1030 +#: forms.py:69 forms.py:371 forms.py:1009 forms.py:1031 forms.py:1035 #: models.py:1168 templates/ishtar/sheet_operation.html:144 #: templates/ishtar/blocks/window_tables/parcels.html:10 msgid "Parcels" msgstr "" -#: forms.py:70 forms.py:203 forms.py:980 models.py:1154 +#: forms.py:72 forms.py:205 forms.py:985 models.py:1154 #: templates/ishtar/blocks/window_tables/parcels.html:7 #: templates/ishtar/dashboards/dashboard_operation.html:432 #: templates/ishtar/dashboards/dashboard_operation.html:446 @@ -23,96 +23,96 @@ msgstr "" msgid "Town" msgstr "" -#: forms.py:72 forms.py:459 forms.py:755 forms.py:1250 models.py:249 +#: forms.py:74 forms.py:455 forms.py:752 forms.py:1255 models.py:249 #: models.py:971 models.py:1152 #: templates/ishtar/blocks/window_tables/parcels.html:8 msgid "Year" msgstr "" -#: forms.py:75 models.py:1155 +#: forms.py:77 models.py:1155 #: templates/ishtar/blocks/window_tables/parcels.html:9 msgid "Section" msgstr "" -#: forms.py:78 models.py:1157 +#: forms.py:80 models.py:1157 msgid "Parcel number" msgstr "" -#: forms.py:80 models.py:1159 models.py:1176 models.py:1225 +#: forms.py:82 models.py:1159 models.py:1176 models.py:1225 msgid "Public domain" msgstr "" -#: forms.py:124 +#: forms.py:126 msgid "Town section is required." msgstr "" -#: forms.py:160 +#: forms.py:162 msgid "public domain" msgstr "" -#: forms.py:167 +#: forms.py:169 msgid "Current parcels" msgstr "" -#: forms.py:169 +#: forms.py:171 msgid "Deleted parcels" msgstr "" -#: forms.py:206 +#: forms.py:208 msgid "Full text input" msgstr "" -#: forms.py:208 +#: forms.py:210 msgid "example: \"2013: XD:1 to 13,24,33 to 39, YD:24\" or \"AB:24,AC:42\"" msgstr "" -#: forms.py:363 +#: forms.py:365 msgid "There are identical parcels." msgstr "" -#: forms.py:378 +#: forms.py:380 msgid "Relation type" msgstr "" -#: forms.py:381 ishtar_menu.py:30 models.py:344 models.py:804 models.py:834 +#: forms.py:383 ishtar_menu.py:30 models.py:344 models.py:804 models.py:834 #: models.py:862 models.py:963 models.py:1151 wizards.py:339 wizards.py:350 #: templates/ishtar/sheet_operation.html:4 msgid "Operation" msgstr "" -#: forms.py:401 +#: forms.py:403 msgid ":" msgstr "" -#: forms.py:409 forms.py:608 forms.py:1215 +#: forms.py:411 forms.py:605 forms.py:1220 msgid "You should select an operation." msgstr "" -#: forms.py:413 +#: forms.py:415 msgid "You should select a relation type." msgstr "" -#: forms.py:443 +#: forms.py:445 msgid "Current relations" msgstr "" -#: forms.py:445 +#: forms.py:447 msgid "Deleted relations" msgstr "" -#: forms.py:449 templates/ishtar/sheet_operation.html:83 +#: forms.py:451 templates/ishtar/sheet_operation.html:83 msgid "Relations" msgstr "" -#: forms.py:460 forms.py:1221 models.py:250 +#: forms.py:456 forms.py:1226 models.py:250 msgid "Numeric reference" msgstr "" -#: forms.py:466 forms.py:1261 +#: forms.py:462 forms.py:1266 msgid "Parcel (section/number/public domain)" msgstr "" -#: forms.py:469 forms.py:1264 models.py:805 +#: forms.py:465 forms.py:1269 models.py:805 #: templates/ishtar/dashboards/dashboard_operation.html:390 #: templates/ishtar/dashboards/dashboard_operation.html:411 #: templates/ishtar/dashboards/dashboard_operation.html:643 @@ -121,211 +121,211 @@ msgstr "" msgid "Department" msgstr "" -#: forms.py:470 forms.py:1092 models.py:85 +#: forms.py:466 forms.py:1097 models.py:85 #: templates/ishtar/blocks/window_tables/archaeologicalsites.html:8 msgid "Name" msgstr "" -#: forms.py:472 forms.py:675 forms.py:753 forms.py:1227 models.py:257 +#: forms.py:468 forms.py:672 forms.py:750 forms.py:1232 models.py:257 msgid "Operation type" msgstr "" -#: forms.py:474 +#: forms.py:470 msgid "Is open?" msgstr "" -#: forms.py:483 forms.py:782 models.py:246 +#: forms.py:478 forms.py:782 models.py:246 msgid "In charge" msgstr "" -#: forms.py:490 models.py:957 +#: forms.py:485 models.py:957 msgid "Scientist in charge" msgstr "" -#: forms.py:492 forms.py:677 forms.py:773 models.py:244 +#: forms.py:487 forms.py:674 forms.py:772 models.py:244 msgid "Operator" msgstr "" -#: forms.py:499 forms.py:1097 models.py:89 models.py:259 +#: forms.py:496 forms.py:1102 models.py:89 models.py:259 #: templates/ishtar/blocks/window_tables/archaeologicalsites.html:10 msgid "Remains" msgstr "" -#: forms.py:500 forms.py:1075 forms.py:1094 models.py:87 models.py:265 +#: forms.py:497 forms.py:1080 forms.py:1099 models.py:87 models.py:265 #: templates/ishtar/blocks/window_tables/archaeologicalsites.html:9 msgid "Periods" msgstr "" -#: forms.py:501 +#: forms.py:498 msgid "Started before" msgstr "" -#: forms.py:503 +#: forms.py:500 msgid "Started after" msgstr "" -#: forms.py:505 +#: forms.py:502 msgid "Ended before" msgstr "" -#: forms.py:507 +#: forms.py:504 msgid "Ended after" msgstr "" -#: forms.py:510 +#: forms.py:507 msgid "Search within relations" msgstr "" -#: forms.py:512 forms.py:832 +#: forms.py:509 forms.py:837 msgid "Comment" msgstr "" -#: forms.py:513 +#: forms.py:510 msgid "Abstract (full text search)" msgstr "" -#: forms.py:515 forms.py:835 models.py:313 +#: forms.py:512 forms.py:840 models.py:313 msgid "Comment about scientific documentation" msgstr "" -#: forms.py:516 forms.py:837 models.py:325 +#: forms.py:513 forms.py:842 models.py:325 msgid "Record quality" msgstr "" -#: forms.py:517 forms.py:805 models.py:277 +#: forms.py:514 forms.py:807 models.py:277 msgid "Report processing" msgstr "" -#: forms.py:519 forms.py:840 models.py:320 +#: forms.py:516 forms.py:845 models.py:320 msgid "Virtual operation" msgstr "" -#: forms.py:521 forms.py:1141 +#: forms.py:518 forms.py:1146 msgid "Archaelogical site" msgstr "" -#: forms.py:527 forms.py:1268 +#: forms.py:524 forms.py:1273 msgid "Created by" msgstr "" -#: forms.py:533 forms.py:1274 +#: forms.py:530 forms.py:1279 msgid "Modified by" msgstr "" -#: forms.py:540 +#: forms.py:537 msgid "Documentation deadline before" msgstr "" -#: forms.py:542 +#: forms.py:539 msgid "Documentation deadline after" msgstr "" -#: forms.py:544 forms.py:825 models.py:332 +#: forms.py:541 forms.py:830 models.py:332 msgid "Documentation received" msgstr "" -#: forms.py:546 +#: forms.py:543 msgid "Finds deadline before" msgstr "" -#: forms.py:548 +#: forms.py:545 msgid "Finds deadline after" msgstr "" -#: forms.py:550 forms.py:830 models.py:336 +#: forms.py:547 forms.py:835 models.py:336 msgid "Finds received" msgstr "" -#: forms.py:595 forms.py:1213 views.py:168 +#: forms.py:592 forms.py:1218 views.py:168 msgid "Operation search" msgstr "" -#: forms.py:639 +#: forms.py:636 msgid "Associated file" msgstr "" -#: forms.py:643 forms.py:928 models.py:968 wizards.py:76 +#: forms.py:640 forms.py:933 models.py:968 wizards.py:76 msgid "Archaelogical file" msgstr "" -#: forms.py:650 forms.py:652 models.py:327 +#: forms.py:647 forms.py:649 models.py:327 msgid "Abstract" msgstr "" -#: forms.py:655 +#: forms.py:652 msgid "months" msgstr "" -#: forms.py:655 +#: forms.py:652 msgid "years" msgstr "" -#: forms.py:657 models.py:230 +#: forms.py:654 models.py:230 msgid "Creation date" msgstr "" -#: forms.py:658 +#: forms.py:655 msgid "Start of field work" msgstr "" -#: forms.py:660 +#: forms.py:657 msgid "All" msgstr "" -#: forms.py:661 +#: forms.py:658 msgid "Preventive" msgstr "" -#: forms.py:662 +#: forms.py:659 msgid "Research" msgstr "" -#: forms.py:666 +#: forms.py:663 msgid "Slicing" msgstr "" -#: forms.py:669 +#: forms.py:666 msgid "Department detail" msgstr "" -#: forms.py:671 +#: forms.py:668 msgid "Date get from" msgstr "" -#: forms.py:673 +#: forms.py:670 msgid "Preventive/Research" msgstr "" -#: forms.py:679 +#: forms.py:676 msgid "Date after" msgstr "" -#: forms.py:681 +#: forms.py:678 msgid "Date before" msgstr "" -#: forms.py:683 +#: forms.py:680 msgid "With reports" msgstr "" -#: forms.py:684 +#: forms.py:681 msgid "With finds" msgstr "" -#: forms.py:736 forms.py:1322 templates/ishtar/sheet_administrativeact.html:13 +#: forms.py:733 forms.py:1327 templates/ishtar/sheet_administrativeact.html:13 #: templates/ishtar/sheet_operation.html:24 msgid "General" msgstr "" -#: forms.py:751 models.py:310 +#: forms.py:748 models.py:310 msgid "Generic name" msgstr "" -#: forms.py:760 models.py:279 +#: forms.py:757 models.py:279 msgid "Old code" msgstr "" -#: forms.py:763 +#: forms.py:760 msgid "Head scientist" msgstr "" @@ -333,245 +333,245 @@ msgstr "" msgid "Operator reference" msgstr "" -#: forms.py:791 +#: forms.py:793 msgid "Total surface (m2)" msgstr "" -#: forms.py:798 models.py:53 models.py:233 models.py:1341 +#: forms.py:800 models.py:53 models.py:233 models.py:1341 msgid "Start date" msgstr "" -#: forms.py:800 models.py:235 +#: forms.py:802 models.py:235 msgid "Excavation end date" msgstr "" -#: forms.py:803 models.py:236 +#: forms.py:805 models.py:236 msgid "Report delivery date" msgstr "" -#: forms.py:822 models.py:329 +#: forms.py:827 models.py:329 msgid "Deadline for submission of the documentation" msgstr "" -#: forms.py:827 models.py:334 +#: forms.py:832 models.py:334 msgid "Deadline for submission of the finds" msgstr "" -#: forms.py:842 +#: forms.py:847 msgid "Image" msgstr "" -#: forms.py:843 +#: forms.py:848 #, python-format msgid "" "

Heavy images are resized to: %(width)dx%(height)d (ratio is preserved)." msgstr "" -#: forms.py:881 +#: forms.py:886 msgid "" "If you want to set an excavation end date you have to provide a start date." msgstr "" -#: forms.py:886 +#: forms.py:891 msgid "The excavation end date cannot be before the start date." msgstr "" -#: forms.py:914 +#: forms.py:919 #, python-format msgid "" "Operation code already exist for year: %(year)d - use a value bigger than " "%(last_val)d" msgstr "" -#: forms.py:918 +#: forms.py:923 msgid "Bad operation code" msgstr "" -#: forms.py:924 models.py:486 +#: forms.py:929 models.py:486 msgid "Operation code" msgstr "" -#: forms.py:950 +#: forms.py:955 msgid "Preventive informations - excavation" msgstr "" -#: forms.py:951 models.py:263 +#: forms.py:956 models.py:263 #: templates/ishtar/dashboards/dashboard_operation.html:701 msgid "Cost (euros)" msgstr "" -#: forms.py:952 models.py:268 +#: forms.py:957 models.py:268 msgid "Scheduled man-days" msgstr "" -#: forms.py:954 models.py:271 +#: forms.py:959 models.py:271 msgid "Optional man-days" msgstr "" -#: forms.py:956 models.py:274 +#: forms.py:961 models.py:274 msgid "Effective man-days" msgstr "" -#: forms.py:966 +#: forms.py:971 msgid "Preventive informations - diagnostic" msgstr "" -#: forms.py:969 models.py:293 +#: forms.py:974 models.py:293 msgid "Prescription on zoning" msgstr "" -#: forms.py:971 models.py:296 +#: forms.py:976 models.py:296 msgid "Prescription on large area" msgstr "" -#: forms.py:974 models.py:298 +#: forms.py:979 models.py:298 msgid "Prescription on geoarchaeological context" msgstr "" -#: forms.py:978 forms.py:1000 models.py:261 models.py:981 +#: forms.py:983 forms.py:1005 models.py:261 models.py:981 msgid "Towns" msgstr "" -#: forms.py:1007 models.py:1167 models.py:1339 +#: forms.py:1012 models.py:1167 models.py:1339 msgid "Parcel" msgstr "" -#: forms.py:1059 models.py:45 +#: forms.py:1064 models.py:45 msgid "Remain types" msgstr "" -#: forms.py:1063 models.py:44 +#: forms.py:1068 models.py:44 msgid "Remain type" msgstr "" -#: forms.py:1079 templates/ishtar/sheet_operation.html:164 +#: forms.py:1084 templates/ishtar/sheet_operation.html:164 #: templates/ishtar/sheet_operation.html:195 msgid "Period" msgstr "" -#: forms.py:1091 models.py:84 +#: forms.py:1096 models.py:84 msgid "Reference" msgstr "" -#: forms.py:1120 +#: forms.py:1125 msgid "This reference already exists." msgstr "" -#: forms.py:1137 models.py:93 +#: forms.py:1142 models.py:93 msgid "Archaeological site" msgstr "" -#: forms.py:1152 models.py:94 models.py:317 +#: forms.py:1157 models.py:94 models.py:317 #: templates/ishtar/sheet_operation.html:94 msgid "Archaeological sites" msgstr "" -#: forms.py:1156 +#: forms.py:1161 msgid "Associated archaelogical sites" msgstr "" -#: forms.py:1162 ishtar_menu.py:33 ishtar_menu.py:63 ishtar_menu.py:92 +#: forms.py:1167 ishtar_menu.py:33 ishtar_menu.py:63 ishtar_menu.py:92 msgid "Search" msgstr "" -#: forms.py:1167 +#: forms.py:1172 msgid "Would you like to close this operation?" msgstr "" -#: forms.py:1172 +#: forms.py:1177 msgid "Would you like to delete this operation?" msgstr "" -#: forms.py:1181 forms.py:1251 forms.py:1387 models.py:836 models.py:948 +#: forms.py:1186 forms.py:1256 forms.py:1392 models.py:836 models.py:948 msgid "Index" msgstr "" -#: forms.py:1207 +#: forms.py:1212 #, python-format msgid "" "Index already exists for operation: %(operation)s - use a value bigger than " "%(last_val)d" msgstr "" -#: forms.py:1219 +#: forms.py:1224 msgid "Operation's year" msgstr "" -#: forms.py:1226 +#: forms.py:1231 msgid "Operation's town" msgstr "" -#: forms.py:1239 +#: forms.py:1244 msgid "Documentation search" msgstr "" -#: forms.py:1241 +#: forms.py:1246 msgid "You should select a document." msgstr "" -#: forms.py:1258 forms.py:1325 models.py:873 models.py:942 +#: forms.py:1263 forms.py:1330 models.py:873 models.py:942 msgid "Act type" msgstr "" -#: forms.py:1259 forms.py:1457 +#: forms.py:1264 forms.py:1462 msgid "Indexed?" msgstr "" -#: forms.py:1265 forms.py:1330 models.py:972 +#: forms.py:1270 forms.py:1335 models.py:972 #: templates/ishtar/blocks/window_tables/administrativacts.html:10 msgid "Object" msgstr "" -#: forms.py:1302 views.py:324 +#: forms.py:1307 views.py:324 msgid "Administrative act search" msgstr "" -#: forms.py:1317 forms.py:1415 forms.py:1482 +#: forms.py:1322 forms.py:1420 forms.py:1487 msgid "You should select an administrative act." msgstr "" -#: forms.py:1333 models.py:969 +#: forms.py:1338 models.py:969 msgid "Signature date" msgstr "" -#: forms.py:1375 +#: forms.py:1380 #, python-format msgid "" "This index already exist for year: %(year)d - use a value bigger than " "%(last_val)d" msgstr "" -#: forms.py:1379 +#: forms.py:1384 msgid "Bad index" msgstr "" -#: forms.py:1392 +#: forms.py:1397 msgid "Would you like to delete this administrative act?" msgstr "" -#: forms.py:1397 +#: forms.py:1402 msgid "Template" msgstr "" -#: forms.py:1421 forms.py:1425 +#: forms.py:1426 forms.py:1430 msgid "This document is not intended for this type of act." msgstr "" -#: forms.py:1443 +#: forms.py:1448 msgid "Doc generation" msgstr "" -#: forms.py:1445 +#: forms.py:1450 msgid "Generate the associated doc?" msgstr "" -#: forms.py:1466 ishtar_menu.py:121 views.py:377 +#: forms.py:1471 ishtar_menu.py:121 views.py:377 msgctxt "admin act register" msgid "Register" msgstr "" -#: ishtar_menu.py:38 +#: ishtar_menu.py:38 ishtar_menu.py:69 ishtar_menu.py:97 msgid "Creation" msgstr "" @@ -592,10 +592,6 @@ msgstr "" msgid "Administrative act" msgstr "" -#: ishtar_menu.py:69 ishtar_menu.py:97 widgets.py:55 -msgid "Add" -msgstr "" - #: ishtar_menu.py:84 msgid "Documents" msgstr "" @@ -1031,6 +1027,10 @@ msgstr "" msgid "Operation: administrative act deletion" msgstr "" +#: widgets.py:55 +msgid "Add" +msgstr "" + #: wizards.py:199 msgid "" "Warning: No Archaelogical File is provided. If you have forget it return to " -- cgit v1.2.3 From e4c0173adc1250fe608f477bb80cbdc5bddc3885 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 14 Nov 2016 19:43:27 +0100 Subject: Explicit CSV headers (refs #3340) --- archaeological_context_records/models.py | 13 ++++++-- archaeological_finds/models.py | 54 ++++++++++++++++---------------- archaeological_operations/models.py | 22 +++++++++++++ ishtar_common/models.py | 13 ++++++-- ishtar_common/views.py | 11 +++++-- 5 files changed, 80 insertions(+), 33 deletions(-) (limited to 'archaeological_operations') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 3f4dc1598..22ff3b095 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -29,7 +29,7 @@ from ishtar_common.utils import cached_label_changed from ishtar_common.models import GeneralType, BaseHistorizedItem, \ HistoricalRecords, OwnPerms, ShortMenuItem, Source, GeneralRelationType,\ GeneralRecordRelations, post_delete_record_relation, get_external_id, \ - ImageModel, post_save_cache + ImageModel, post_save_cache, ValueGetter from archaeological_operations.models import Operation, Period, Parcel @@ -118,7 +118,8 @@ post_save.connect(post_save_cache, sender=IdentificationType) post_delete.connect(post_save_cache, sender=IdentificationType) -class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): +class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, + ValueGetter, ShortMenuItem): SHOW_URL = 'show-contextrecord' SLUG = 'contextrecord' TABLE_COLS = ['parcel__town', 'operation__year', @@ -155,6 +156,14 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): RELATIVE_SESSION_NAMES = [ ('operation', 'operation__pk'), ('file', 'operation__associated_file__pk')] + EXTRA_FULL_FIELDS_LABELS = { + 'parcel__town': _(u"Parcel (town)"), + 'detailled_related_context_records': _(u"Related context records"), + 'operation__code_patriarche': u"Operation (code patriarche)", + 'parcel__external_id': _(u"Parcel (external ID)"), + 'datings__period': _(u"Datings (period)"), + 'parcel__year': _(u"Parcel (year)"), + } # fields external_id = models.TextField(_(u"External ID"), blank=True, null=True) diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index aa5eacc30..6dcbbce65 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -291,41 +291,41 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): CHECK_DICT = dict(CHECK_CHOICES) SHOW_URL = 'show-find' SLUG = 'find' - TABLE_COLS = ['label', 'material_types', 'datings.period', - 'base_finds.context_record.parcel.town', - 'base_finds.context_record.operation.year', - 'base_finds.context_record.operation.operation_code', - 'container.reference', 'container.location', - 'base_finds.batch', - 'base_finds.context_record.parcel.town', - 'base_finds.context_record.parcel', ] + TABLE_COLS = ['label', 'material_types', 'datings__period', + 'base_finds__context_record__parcel__town', + 'base_finds__context_record__operation__year', + 'base_finds__context_record__operation__operation_code', + 'container__reference', 'container__location', + 'base_finds__batch', + 'base_finds__context_record__parcel__town', + 'base_finds__context_record__parcel', ] if settings.COUNTRY == 'fr': TABLE_COLS.insert( - 6, 'base_finds.context_record.operation.code_patriarche') + 6, 'base_finds__context_record__operation__code_patriarche') TABLE_COLS_FOR_OPE = [ - 'base_finds.cache_short_id', - 'base_finds.cache_complete_id', + 'base_finds__cache_short_id', + 'base_finds__cache_complete_id', 'previous_id', 'label', 'material_types', - 'datings.period', 'find_number', 'object_types', + 'datings__period', 'find_number', 'object_types', 'description', - 'base_finds.context_record.parcel.town', - 'base_finds.context_record.parcel', ] + 'base_finds__context_record__parcel__town', + 'base_finds__context_record__parcel', ] EXTRA_FULL_FIELDS = [ - 'base_finds.cache_short_id', 'base_finds.cache_complete_id', - 'base_finds.comment', 'base_finds.description', - 'base_finds.topographic_localisation', - 'base_finds.special_interest', - 'base_finds.discovery_date'] + 'base_finds__cache_short_id', 'base_finds__cache_complete_id', + 'base_finds__comment', 'base_finds__description', + 'base_finds__topographic_localisation', + 'base_finds__special_interest', + 'base_finds__discovery_date'] EXTRA_FULL_FIELDS_LABELS = { - 'base_finds.cache_short_id': _(u"Base find - Short ID"), - 'base_finds.cache_complete_id': _(u"Base find - Complete ID"), - 'base_finds.comment': _(u"Base find - Comment"), - 'base_finds.description': _(u"Base find - Description"), - 'base_finds.topographic_localisation': _(u"Base find - " - u"Topographic localisation"), - 'base_finds.special_interest': _(u"Base find - Special interest"), - 'base_finds.discovery_date': _(u"Base find - Discovery date"), + 'base_finds__cache_short_id': _(u"Base find - Short ID"), + 'base_finds__cache_complete_id': _(u"Base find - Complete ID"), + 'base_finds__comment': _(u"Base find - Comment"), + 'base_finds__description': _(u"Base find - Description"), + 'base_finds__topographic_localisation': _(u"Base find - " + u"Topographic localisation"), + 'base_finds__special_interest': _(u"Base find - Special interest"), + 'base_finds__discovery_date': _(u"Base find - Discovery date"), } ATTRS_EQUIV = {'get_first_base_find': 'base_finds'} diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 14e5e1f7e..1e108e98c 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -225,6 +225,28 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, 'finds_deadline_before': 'finds_deadline__lte', 'finds_deadline_after': 'finds_deadline__gte', } + EXTRA_FULL_FIELDS_LABELS = { + 'full_code_patriarche': u"Code patriarche", + 'year_index': _(u"Year - Index"), + 'associated_file_short_label': _(u"Associated file (label)"), + 'operator__name': _(u"Operator name"), + 'scientist__raw_name': _(u"Scientist (full name)"), + 'associated_file__external_id': _(u"Associated file (external ID)"), + 'scientist__title': _(u"Scientist (title)"), + 'scientist__surname': _(u"Scientist (surname)"), + 'scientist__name': _(u"Scientist (name)"), + 'scientist__attached_to__name': _(u"Scientist - Organization (name)"), + 'in_charge__title': _(u"In charge (title)"), + 'in_charge__surname': _(u"In charge (surname)"), + 'in_charge__name': _(u"In charge (name)"), + 'in_charge__attached_to__name': _(u"In charge - Organization (name)"), + 'cira_rapporteur__surname': u"Rapporteur CIRA (prénom)", + 'cira_rapporteur__name': u"Rapporteur CIRA (nom)", + 'cira_rapporteur__attached_to__name': u"Rapporteur CIRA - " + u"Organisation (nom)", + 'archaeological_sites__reference': _(u"Archaeological sites (" + u"reference)"), + } # fields definition creation_date = models.DateField(_(u"Creation date"), diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 72a3432f8..5b822c7dd 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -25,6 +25,7 @@ import copy import datetime from PIL import Image from importlib import import_module +import logging import os import re import shutil @@ -65,6 +66,9 @@ from ishtar_common.data_importer import Importer, ImportFormater, \ TypeFormater, YearFormater, StrToBoolean, FileFormater +logger = logging.getLogger(__name__) + + def post_save_user(sender, **kwargs): user = kwargs['instance'] try: @@ -95,6 +99,7 @@ class Imported(models.Model): class ValueGetter(object): _prefix = "" GET_VALUES_EXTRA = [] + EXTRA_FULL_FIELDS_LABELS = {} def get_values(self, prefix=''): if not prefix: @@ -1607,7 +1612,7 @@ def get_importer_models(): ('archaeological_context_records.models.RecordRelations', _(u"Context record relations"))] + MODELS MODELS = [('archaeological_finds.models.BaseFind', - _(u"Finds")), ] + MODELS + _(u"Base finds")), ] + MODELS return MODELS @@ -1995,7 +2000,9 @@ TARGET_MODELS = [ ('archaeological_operations.models.OperationType', _(u"Operation type")), ('archaeological_operations.models.Period', _(u"Period")), ('archaeological_operations.models.ReportState', _(u"Report state")), + ('archaeological_operations.models.RemainType', _(u"Remain type")), ('archaeological_context_records.models.Unit', _(u"Unit")), + ('archaeological_context_records.models.ActivityType', _(u"Activity type")), ('archaeological_finds.models.MaterialType', _(u"Material")), ('archaeological_finds.models.ConservatoryState', _(u"Conservatory state")), @@ -2077,7 +2084,9 @@ class FormaterType(models.Model): kwargs['many_split'] = self.many_split if self.formater_type == 'TypeFormater': if self.options not in TARGET_MODELS_KEYS: - print('%s not in TARGET_MODELS_KEYS' % self.options) + logger.warning( + "**WARN FormaterType.get_formater_type**: {} " + "is not in TARGET_MODELS_KEYS".format(self.options)) return model = None if self.options in dir(): diff --git a/ishtar_common/views.py b/ishtar_common/views.py index cd34a2019..8634125cd 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -981,8 +981,8 @@ def get_item(model, func_name, default_name, extra_request_keys=[], lnk = link_template % reverse('show-' + default_name, args=[data[0], '']) except NoReverseMatch: - print( - '"show-' + default_name + "\" args (" + logger.warning( + '**WARN "show-' + default_name + '" args (' + unicode(data[0]) + ") url not available") lnk = '' res = {'id': data[0], 'link': lnk} @@ -1027,6 +1027,8 @@ def get_item(model, func_name, default_name, extra_request_keys=[], writer = csv.writer(response, **CSV_OPTIONS) col_names = [] for field_name in table_cols: + if type(field_name) in (list, tuple): + field_name = " ; ".join(field_name) if hasattr(model, 'EXTRA_FULL_FIELDS_LABELS') and\ field_name in model.EXTRA_FULL_FIELDS_LABELS: field = model.EXTRA_FULL_FIELDS_LABELS[field_name] @@ -1037,6 +1039,11 @@ def get_item(model, func_name, default_name, extra_request_keys=[], field = model._meta.get_field(field_name) except: col_names.append(u"".encode(ENCODING)) + logger.warning( + "**WARN get_item - csv export**: no col name for " + "{}\nadd explicit label to " + "EXTRA_FULL_FIELDS_LABELS attribute of " + "{}".format(field_name, model)) continue col_names.append( unicode(field.verbose_name).encode(ENCODING)) -- cgit v1.2.3