summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-09 18:09:37 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-01-09 18:11:10 +0100
commite8373b2d7c1ef6c554aeadd93b577001b049000e (patch)
treec65b5086bd4db147751de5a0d7d1b578d9c8944e /archaeological_context_records/models.py
parent042861251b5615c5c89740b82e45862c8fcde088 (diff)
downloadIshtar-e8373b2d7c1ef6c554aeadd93b577001b049000e.tar.bz2
Ishtar-e8373b2d7c1ef6c554aeadd93b577001b049000e.zip
Contex record: fix relation tables
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 5e4d31c3b..cf39870ca 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -128,8 +128,9 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms,
if settings.COUNTRY == 'fr':
TABLE_COLS.insert(1, 'operation__code_patriarche')
TABLE_COLS_FOR_OPE = ['label', 'parcel', 'unit',
- 'datings__period', 'description']
- COL_LABELS = {'section__parcel_number': _("Parcel")}
+ 'datings__period__label', 'description']
+ COL_LABELS = {'section__parcel_number': _(u"Parcel"),
+ 'datings__period__label': _(u"Periods")}
CONTEXTUAL_TABLE_COLS = {
'full': {
'related_context_records': 'detailled_related_context_records'
@@ -401,10 +402,9 @@ class RecordRelations(GeneralRecordRelations, models.Model):
relation_type = models.ForeignKey(RelationType)
TABLE_COLS = [
"left_record__label", "left_record__unit", "left_record__parcel",
- "left_record__datings__period", "left_record__description",
"relation_type",
"right_record__label", "right_record__unit", "right_record__parcel",
- "right_record__datings__period", "right_record__description"]
+ ]
COL_LABELS = {
"left_record__label": _(u"ID (left)"),
"left_record__unit": _(u"Unit (left)"),
@@ -412,8 +412,8 @@ class RecordRelations(GeneralRecordRelations, models.Model):
"left_record__description": _(u"Description (left)"),
"left_record__datings__period": _(u"Periods (left)"),
"relation_type": _(u"Relation type"),
- "right_record__label": _(u"Unit (right)"),
- "right_record__unit": _(u"Parcel (right)"),
+ "right_record__label": _(u"ID (right)"),
+ "right_record__unit": _(u"Unit (right)"),
"right_record__parcel": _(u"Parcel (right)"),
"right_record__description": _(u"Description (right)"),
"right_record__datings__period": _(u"Periods (right)")
@@ -456,6 +456,11 @@ class RecordRelationView(models.Model):
"right_record__description": _(u"Description"),
"right_record__datings__period": _(u"Periods")
}
+
+ # search parameters
+ EXTRA_REQUEST_KEYS = {
+ "left_record_id": "left_record_id"
+ }
left_record = models.ForeignKey(ContextRecord, related_name='+',
on_delete=models.DO_NOTHING)
right_record = models.ForeignKey(ContextRecord, related_name='+',