summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/locale/django.pot250
-rw-r--r--archaeological_context_records/migrations/0031_auto_20181017_1642.py36
-rw-r--r--archaeological_context_records/migrations/0032_auto_20181017_1854.py25
-rw-r--r--archaeological_context_records/models.py25
4 files changed, 212 insertions, 124 deletions
diff --git a/archaeological_context_records/locale/django.pot b/archaeological_context_records/locale/django.pot
index b6d8256eb..fbd1d8d86 100644
--- a/archaeological_context_records/locale/django.pot
+++ b/archaeological_context_records/locale/django.pot
@@ -13,11 +13,11 @@ msgstr ""
msgid "Point"
msgstr ""
-#: admin.py:51 models.py:377
+#: admin.py:51 models.py:410
msgid "Multi polygon"
msgstr ""
-#: forms.py:47 forms.py:53 models.py:319 wizards.py:77
+#: forms.py:47 forms.py:53 models.py:352 wizards.py:81
msgid "Operation"
msgstr ""
@@ -33,7 +33,7 @@ msgstr ""
msgid "Full text search"
msgstr ""
-#: forms.py:69 forms.py:155 models.py:324 models.py:696
+#: forms.py:69 forms.py:155 models.py:357 models.py:737
msgid "ID"
msgstr ""
@@ -49,7 +49,7 @@ msgstr ""
msgid "Operation's number (index by year)"
msgstr ""
-#: forms.py:80 models.py:322
+#: forms.py:80 models.py:355
msgid "Archaeological site"
msgstr ""
@@ -57,7 +57,7 @@ msgstr ""
msgid "Search within related operations"
msgstr ""
-#: forms.py:87 forms.py:288 models.py:65
+#: forms.py:87 forms.py:288 models.py:66
msgid "Period"
msgstr ""
@@ -65,7 +65,8 @@ msgstr ""
msgid "Unit type"
msgstr ""
-#: forms.py:89 forms.py:148 models.py:230 models.py:314 models.py:698
+#: forms.py:89 forms.py:148 models.py:231 models.py:232 models.py:347
+#: models.py:739
msgid "Parcel"
msgstr ""
@@ -73,7 +74,7 @@ msgstr ""
msgid "Search within relations"
msgstr ""
-#: forms.py:115 views.py:96
+#: forms.py:115 views.py:95
msgid "Context record search"
msgstr ""
@@ -89,7 +90,7 @@ msgstr ""
msgid "Context record - 020 - General"
msgstr ""
-#: forms.py:149 models.py:227 models.py:228 models.py:317
+#: forms.py:149 models.py:228 models.py:229 models.py:350
msgid "Town"
msgstr ""
@@ -97,52 +98,52 @@ msgstr ""
msgid "Only the items associated to the operation can be selected."
msgstr ""
-#: forms.py:157 models.py:325 models.py:699
+#: forms.py:157 models.py:358 models.py:740
#: templates/ishtar/sheet_contextrecord.html:45
msgid "Description"
msgstr ""
-#: forms.py:159 models.py:326
+#: forms.py:159 models.py:359
msgid "General comment"
msgstr ""
-#: forms.py:162 models.py:372
+#: forms.py:162 models.py:405
msgid "Excavation technique"
msgstr ""
-#: forms.py:163 models.py:330
+#: forms.py:163 models.py:363
msgid "Length (m)"
msgstr ""
-#: forms.py:164 models.py:331
+#: forms.py:164 models.py:364
msgid "Width (m)"
msgstr ""
-#: forms.py:165 models.py:332
+#: forms.py:165 models.py:365
msgid "Thickness (m)"
msgstr ""
-#: forms.py:166 models.py:334
+#: forms.py:166 models.py:367
msgid "Diameter (m)"
msgstr ""
-#: forms.py:167 models.py:335
+#: forms.py:167 models.py:368
msgid "Depth (m)"
msgstr ""
-#: forms.py:169 models.py:337
+#: forms.py:169 models.py:370
msgid "Depth of appearance (m)"
msgstr ""
-#: forms.py:170 models.py:346 models.py:697
+#: forms.py:170 models.py:379 models.py:738
msgid "Context record type"
msgstr ""
-#: forms.py:172 models.py:327
+#: forms.py:172 models.py:360
msgid "Opening date"
msgstr ""
-#: forms.py:174 models.py:329 templates/ishtar/sheet_contextrecord.html:128
+#: forms.py:174 models.py:362 templates/ishtar/sheet_contextrecord.html:140
msgid "Closing date"
msgstr ""
@@ -150,7 +151,7 @@ msgstr ""
msgid "Documentation"
msgstr ""
-#: forms.py:180 models.py:339
+#: forms.py:180 models.py:372
msgid "Location"
msgstr ""
@@ -162,23 +163,23 @@ msgstr ""
msgid "You have to choose a town or a parcel."
msgstr ""
-#: forms.py:283 forms.py:304 models.py:76
+#: forms.py:283 forms.py:304 models.py:77
msgid "Dating"
msgstr ""
-#: forms.py:289 models.py:66
+#: forms.py:289 models.py:67
msgid "Start date"
msgstr ""
-#: forms.py:290 models.py:67
+#: forms.py:290 models.py:68
msgid "End date"
msgstr ""
-#: forms.py:291 models.py:70
+#: forms.py:291 models.py:71
msgid "Quality"
msgstr ""
-#: forms.py:292 models.py:44 models.py:68
+#: forms.py:292 models.py:45 models.py:69
msgid "Dating type"
msgstr ""
@@ -186,7 +187,7 @@ msgstr ""
msgid "Context record - 030 - Dating"
msgstr ""
-#: forms.py:315 ishtar_menu.py:29 models.py:90
+#: forms.py:315 ishtar_menu.py:29 models.py:91
msgid "Context record"
msgstr ""
@@ -198,8 +199,8 @@ msgstr ""
msgid "Context record - 050 - Relations"
msgstr ""
-#: forms.py:337 forms.py:348 models.py:349
-#: templates/ishtar/sheet_contextrecord.html:59
+#: forms.py:337 forms.py:348 models.py:382
+#: templates/ishtar/sheet_contextrecord.html:64
msgid "Interpretation"
msgstr ""
@@ -211,31 +212,31 @@ msgstr ""
msgid "Comments on dating"
msgstr ""
-#: forms.py:346 models.py:348
+#: forms.py:346 models.py:381
msgid "Filling"
msgstr ""
-#: forms.py:350 models.py:369
+#: forms.py:350 models.py:402
msgid "Activity"
msgstr ""
-#: forms.py:352 models.py:367
+#: forms.py:352 models.py:400
msgid "Identification"
msgstr ""
-#: forms.py:354 models.py:352
+#: forms.py:354 models.py:385
msgid "TAQ"
msgstr ""
-#: forms.py:355 models.py:356
+#: forms.py:355 models.py:389
msgid "Estimated TAQ"
msgstr ""
-#: forms.py:357 models.py:359
+#: forms.py:357 models.py:392
msgid "TPQ"
msgstr ""
-#: forms.py:358 models.py:363
+#: forms.py:358 models.py:396
msgid "Estimated TPQ"
msgstr ""
@@ -267,354 +268,363 @@ msgstr ""
msgid "Deletion"
msgstr ""
-#: models.py:45
+#: models.py:46
msgid "Dating types"
msgstr ""
-#: models.py:55
+#: models.py:56
msgid "Dating quality type"
msgstr ""
-#: models.py:56
+#: models.py:57
msgid "Dating quality types"
msgstr ""
-#: models.py:72
+#: models.py:73
msgid "Precise dating"
msgstr ""
-#: models.py:77
+#: models.py:78
msgid "Datings"
msgstr ""
-#: models.py:97
+#: models.py:98
msgid "Find"
msgstr ""
-#: models.py:116 models.py:135 models.py:151
+#: models.py:117 models.py:136 models.py:152
msgid "Order"
msgstr ""
-#: models.py:118
+#: models.py:119
msgid "Parent context record type"
msgstr ""
-#: models.py:122
+#: models.py:123
msgid "Context record Type"
msgstr ""
-#: models.py:123
+#: models.py:124
msgid "Context record Types"
msgstr ""
-#: models.py:138
+#: models.py:139
msgid "Activity Type"
msgstr ""
-#: models.py:139
+#: models.py:140
msgid "Activity Types"
msgstr ""
-#: models.py:154
+#: models.py:155
msgid "Identification Type"
msgstr ""
-#: models.py:155
+#: models.py:156
msgid "Identification Types"
msgstr ""
-#: models.py:168
+#: models.py:169
msgid "Excavation technique type"
msgstr ""
-#: models.py:169
+#: models.py:170
msgid "Excavation technique types"
msgstr ""
-#: models.py:179
+#: models.py:180
msgid "Documentation type"
msgstr ""
-#: models.py:180
+#: models.py:181
msgid "Documentation types"
msgstr ""
-#: models.py:221 models.py:700
+#: models.py:222 models.py:741
msgid "Periods"
msgstr ""
-#: models.py:222
+#: models.py:223
msgid "Datings (period)"
msgstr ""
-#: models.py:223
+#: models.py:224
msgid "Related context records"
msgstr ""
-#: models.py:224
+#: models.py:225
msgid "Operation (Patriarche code)"
msgstr ""
-#: models.py:225
+#: models.py:226
msgid "Operation (name)"
msgstr ""
-#: models.py:226
+#: models.py:227
msgid "Parcel (external ID)"
msgstr ""
-#: models.py:229
+#: models.py:230
msgid "Parcel (year)"
msgstr ""
-#: models.py:262
+#: models.py:265
msgctxt "key for text search"
msgid "id"
msgstr ""
-#: models.py:266
+#: models.py:269
msgctxt "key for text search"
msgid "town"
msgstr ""
-#: models.py:270
+#: models.py:273
msgctxt "key for text search"
msgid "operation-year"
msgstr ""
-#: models.py:274
+#: models.py:277
msgctxt "key for text search"
msgid "patriarche"
msgstr ""
-#: models.py:278
+#: models.py:281
msgctxt "key for text search"
msgid "operation-code"
msgstr ""
-#: models.py:282
+#: models.py:285 models.py:327
+msgctxt "key for text search"
+msgid "operation"
+msgstr ""
+
+#: models.py:289 models.py:330
msgctxt "key for text search"
msgid "site"
msgstr ""
-#: models.py:286
+#: models.py:293
msgctxt "key for text search"
msgid "operation-relation-type"
msgstr ""
-#: models.py:290
+#: models.py:297
msgctxt "key for text search"
msgid "period"
msgstr ""
-#: models.py:294
+#: models.py:301
msgctxt "key for text search"
msgid "unit-type"
msgstr ""
-#: models.py:298
+#: models.py:305
msgctxt "key for text search"
msgid "parcel"
msgstr ""
-#: models.py:302
+#: models.py:309
msgctxt "key for text search"
msgid "record-relation-type"
msgstr ""
-#: models.py:310
+#: models.py:343
msgid "External ID"
msgstr ""
-#: models.py:312
+#: models.py:345
msgid "External ID is set automatically"
msgstr ""
-#: models.py:340
+#: models.py:373
msgid "A short description of the location of the context record"
msgstr ""
-#: models.py:344
+#: models.py:377
msgid "Comment on datings"
msgstr ""
-#: models.py:353
+#: models.py:386
msgid ""
"\"Terminus Ante Quem\" the context record can't have been created after this "
"date"
msgstr ""
-#: models.py:357
+#: models.py:390
msgid "Estimation of a \"Terminus Ante Quem\""
msgstr ""
-#: models.py:360
+#: models.py:393
msgid ""
"\"Terminus Post Quem\" the context record can't have been created before "
"this date"
msgstr ""
-#: models.py:364
+#: models.py:397
msgid "Estimation of a \"Terminus Post Quem\""
msgstr ""
-#: models.py:375
+#: models.py:408
msgid "Point (2D)"
msgstr ""
-#: models.py:376
+#: models.py:409
msgid "Point (3D)"
msgstr ""
-#: models.py:380
+#: models.py:413
msgid "Documents"
msgstr ""
-#: models.py:382
+#: models.py:415
msgid "Cached name"
msgstr ""
-#: models.py:393 models.py:394 templates/ishtar/sheet_contextrecord.html:4
+#: models.py:419 models.py:420 templates/ishtar/sheet_contextrecord.html:4
msgid "Context Record"
msgstr ""
-#: models.py:410
+#: models.py:439
msgctxt "short"
msgid "Context record"
msgstr ""
-#: models.py:627 models.py:650 models.py:695
+#: models.py:668 models.py:691 models.py:736
msgid "Relation type"
msgstr ""
-#: models.py:628
+#: models.py:669
msgid "Relation types"
msgstr ""
-#: models.py:645
+#: models.py:686
msgid "ID (left)"
msgstr ""
-#: models.py:646
+#: models.py:687
msgid "Context record type (left)"
msgstr ""
-#: models.py:647
+#: models.py:688
msgid "Parcel (left)"
msgstr ""
-#: models.py:648
+#: models.py:689
msgid "Description (left)"
msgstr ""
-#: models.py:649
+#: models.py:690
msgid "Periods (left)"
msgstr ""
-#: models.py:651
+#: models.py:692
msgid "ID (right)"
msgstr ""
-#: models.py:652
+#: models.py:693
msgid "Context record type (right)"
msgstr ""
-#: models.py:653
+#: models.py:694
msgid "Parcel (right)"
msgstr ""
-#: models.py:654
+#: models.py:695
msgid "Description (right)"
msgstr ""
-#: models.py:655
+#: models.py:696
msgid "Periods (right)"
msgstr ""
-#: models.py:664
+#: models.py:705
msgid "Record relation"
msgstr ""
-#: models.py:665
+#: models.py:706
msgid "Record relations"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:70
+#: templates/ishtar/sheet_contextrecord.html:75
msgid "Datations"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:79
+#: templates/ishtar/sheet_contextrecord.html:84
+msgid "Sheet"
+msgstr ""
+
+#: templates/ishtar/sheet_contextrecord.html:91
msgid "Context record relations"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:97
+#: templates/ishtar/sheet_contextrecord.html:109
msgid "Re-generate image"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:99
+#: templates/ishtar/sheet_contextrecord.html:111
msgid "Generate image"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:108
+#: templates/ishtar/sheet_contextrecord.html:120
msgid "Operation summary"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:111
+#: templates/ishtar/sheet_contextrecord.html:123
msgid "Patriarche OA code not yet recorded!"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:116
+#: templates/ishtar/sheet_contextrecord.html:128
msgid "Numerical reference"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:122
+#: templates/ishtar/sheet_contextrecord.html:134
msgid "State"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:123
+#: templates/ishtar/sheet_contextrecord.html:135
msgid "Active file"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:123
+#: templates/ishtar/sheet_contextrecord.html:135
msgid "Closed operation"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:130
+#: templates/ishtar/sheet_contextrecord.html:142
msgid "by"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:140
+#: templates/ishtar/sheet_contextrecord.html:152
msgid "Localisation"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:149
+#: templates/ishtar/sheet_contextrecord.html:161
msgid "No operation linked to this context record!"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:161
+#: templates/ishtar/sheet_contextrecord.html:173
msgid "Document from this context record"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:166
+#: templates/ishtar/sheet_contextrecord.html:178
msgid "Finds"
msgstr ""
-#: templates/ishtar/sheet_contextrecord.html:171
+#: templates/ishtar/sheet_contextrecord.html:183
msgid "Documents from associated finds"
msgstr ""
-#: views.py:110
+#: views.py:109
msgid "New context record"
msgstr ""
-#: views.py:126
+#: views.py:125
msgid "Context record modification"
msgstr ""
-#: views.py:137
+#: views.py:136
msgid "You don't have sufficient permissions to do this action."
msgstr ""
-#: views.py:150
+#: views.py:149
msgid "Context record deletion"
msgstr ""
diff --git a/archaeological_context_records/migrations/0031_auto_20181017_1642.py b/archaeological_context_records/migrations/0031_auto_20181017_1642.py
new file mode 100644
index 000000000..4ba07813b
--- /dev/null
+++ b/archaeological_context_records/migrations/0031_auto_20181017_1642.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.10 on 2018-10-17 16:42
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import virtualtime
+
+from ishtar_common.utils_migrations import reinit_last_modified
+
+
+def migrate_codes(apps, schema_editor):
+ models = ['contextrecord']
+ reinit_last_modified(
+ apps, 'archaeological_context_records', models
+ )
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archaeological_context_records', '0030_auto_20180619_0911'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='contextrecord',
+ name='last_modified',
+ field=models.DateTimeField(default=virtualtime.virtual_datetime.now),
+ ),
+ migrations.AddField(
+ model_name='historicalcontextrecord',
+ name='last_modified',
+ field=models.DateTimeField(default=virtualtime.virtual_datetime.now),
+ ),
+ migrations.RunPython(migrate_codes)
+ ]
diff --git a/archaeological_context_records/migrations/0032_auto_20181017_1854.py b/archaeological_context_records/migrations/0032_auto_20181017_1854.py
new file mode 100644
index 000000000..1afe06f0a
--- /dev/null
+++ b/archaeological_context_records/migrations/0032_auto_20181017_1854.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.10 on 2018-10-17 18:54
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archaeological_context_records', '0031_auto_20181017_1642'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='contextrecord',
+ name='last_modified',
+ field=models.DateTimeField(auto_now=True),
+ ),
+ migrations.AlterField(
+ model_name='historicalcontextrecord',
+ name='last_modified',
+ field=models.DateTimeField(blank=True, editable=False),
+ ),
+ ]
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 60f8fce1b..89f3edee4 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -254,12 +254,11 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
'label': 'label__icontains',
'archaeological_sites': 'operation__archaeological_sites__pk',
'cached_label': 'cached_label__icontains',
+ 'datings__period__label': 'datings__period__label',
+ 'operation_id': 'operation_id',
}
RELATION_TYPES_PREFIX = {'ope_relation_types': 'operation__',
'cr_relation_types': ''}
- RELATIVE_SESSION_NAMES = [
- ('operation', 'operation__pk'),
- ('file', 'operation__associated_file__pk')]
# alternative names of fields for searches
ALT_NAMES = {
'label': (
@@ -282,6 +281,10 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
pgettext_lazy("key for text search", u"operation-code"),
'operation__operation_code'
),
+ 'operation__cached_label': (
+ pgettext_lazy("key for text search", u"operation"),
+ 'operation__cached_label__icontains'
+ ),
'archaeological_site': (
pgettext_lazy("key for text search", u"site"),
'archaeological_site__cached_label__icontains'
@@ -319,7 +322,22 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
"identification__label", "activity__label",
"excavation_technic__label"]
M2M_SEARCH_VECTORS = ["datings__period__label"]
+ UP_MODEL_QUERY = {
+ "operation": (
+ pgettext_lazy("key for text search", u"operation"),
+ 'cached_label'),
+ "site": (
+ pgettext_lazy("key for text search", u"site"),
+ 'cached_label'),
+ }
+ RELATIVE_SESSION_NAMES = [
+ ('operation', 'operation__pk'),
+ ('site', 'archaeological_site__pk'),
+ ('file', 'operation__associated_file__pk'),
+ ]
+
history = HistoricalRecords()
+ objects = ExternalIdManager()
# fields
external_id = models.TextField(_(u"External ID"), blank=True, null=True)
@@ -396,7 +414,6 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem,
blank=True)
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True,
db_index=True)
- objects = ExternalIdManager()
class Meta:
verbose_name = _(u"Context Record")