summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_context_records/models.py16
-rw-r--r--archaeological_context_records/wizards.py2
-rw-r--r--archaeological_finds/models.py16
3 files changed, 17 insertions, 17 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index 93b37d87e..c6d8ec023 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -91,7 +91,7 @@ class ContextRecord(BaseHistorizedItem, OwnPerms):
'operation.operation_code',
'label', 'unit']
if settings.COUNTRY == 'fr':
- TABLE_COLS.insert(1, 'parcel.operation.code_patriarche')
+ TABLE_COLS.insert(1, 'operation.code_patriarche')
parcel = models.ForeignKey(Parcel, verbose_name=_(u"Parcel"),
related_name='context_record')
operation = models.ForeignKey(Operation, verbose_name=_(u"Operation"),
@@ -148,22 +148,22 @@ class ContextRecord(BaseHistorizedItem, OwnPerms):
self.label] if item])
def full_label(self):
- if not self.parcel.operation:
+ if not self.operation:
return unicode(self)
return self._real_label() or self._temp_label()
def _real_label(self):
- if not self.parcel.operation.code_patriarche:
+ if not self.operation.code_patriarche:
return
- return settings.JOINT.join((self.parcel.operation.code_patriarche,
- self.label))
+ return settings.JOINT.join((self.operation.code_patriarche,
+ self.label))
def _temp_label(self):
- if self.parcel.operation.code_patriarche:
+ if self.operation.code_patriarche:
return
return settings.JOINT.join([unicode(lbl) for lbl in [
- self.parcel.operation.year,
- self.parcel.operation.operation_code,
+ self.operation.year,
+ self.operation.operation_code,
self.label] if lbl])
@classmethod
diff --git a/archaeological_context_records/wizards.py b/archaeological_context_records/wizards.py
index 86ce3bd30..afed15c4e 100644
--- a/archaeological_context_records/wizards.py
+++ b/archaeological_context_records/wizards.py
@@ -44,7 +44,7 @@ class RecordWizard(Wizard):
pass
current_cr = self.get_current_object()
if current_cr:
- return current_cr.parcel.operation
+ return current_cr.operation
# get_template_context
def get_context_data(self, form, **kwargs):
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index e0c72c79a..b5a13868d 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -109,20 +109,20 @@ class BaseFind(BaseHistorizedItem, OwnPerms):
def _real_label(self):
if not self.context_record.parcel \
- or not self.context_record.parcel.operation \
- or not self.context_record.parcel.operation.code_patriarche:
+ or not self.context_record.operation \
+ or not self.context_record.operation.code_patriarche:
return
find = self.get_last_find()
lbl = find.label or self.label
return settings.JOINT.join([unicode(it) for it in (
- self.context_record.parcel.operation.code_patriarche,
+ self.context_record.operation.code_patriarche,
self.context_record.label,
lbl) if it])
def _temp_label(self):
if not self.context_record.parcel \
- or not self.context_record.parcel.operation \
- or not self.context_record.parcel.operation.code_patriarche:
+ or not self.context_record.operation \
+ or not self.context_record.operation.code_patriarche:
return
find = self.get_last_find()
lbl = find.label or self.label
@@ -135,13 +135,13 @@ class BaseFind(BaseHistorizedItem, OwnPerms):
class Find(BaseHistorizedItem, OwnPerms):
TABLE_COLS = ['label', 'material_type', 'dating.period',
'base_finds.context_record.parcel.town',
- 'base_finds.context_record.parcel.operation.year',
- 'base_finds.context_record.parcel.operation.operation_code',
+ 'base_finds.context_record.operation.year',
+ 'base_finds.context_record.operation.operation_code',
'container.reference', 'container.location',
'base_finds.is_isolated']
if settings.COUNTRY == 'fr':
TABLE_COLS.insert(6,
- 'base_finds.context_record.parcel.operation.code_patriarche')
+ 'base_finds.context_record.operation.code_patriarche')
base_finds = models.ManyToManyField(BaseFind, verbose_name=_(u"Base find"),
related_name='find')
order = models.IntegerField(_(u"Order"))