diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-08-25 13:31:45 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-08-25 13:31:45 +0200 |
commit | 6e16f2c830c9dae4450609d66b8b46a091976099 (patch) | |
tree | 3f8393b6e3ebcb517cc6d16d679c262731ef95a9 /archaeological_finds | |
parent | c3181ddb7a6501e2d32b8f370a2c1d5771c37496 (diff) | |
download | Ishtar-6e16f2c830c9dae4450609d66b8b46a091976099.tar.bz2 Ishtar-6e16f2c830c9dae4450609d66b8b46a091976099.zip |
Simplify access to operation for context records (don't use the parcel anymore) (refs #1317)
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/models.py | 16 |
1 files changed, 8 insertions, 8 deletions
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")) |