diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-10-25 12:18:24 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-10-25 12:18:24 +0100 |
commit | b39e8de9c8da4905477d142e7c7dd630864335f8 (patch) | |
tree | 22e09f884928f77709d799cf7bd75a2e687dabc9 /archaeological_finds/models.py | |
parent | 2018f169a8eccdd4f08bdd9cc27edc2e238d1eb6 (diff) | |
download | Ishtar-b39e8de9c8da4905477d142e7c7dd630864335f8.tar.bz2 Ishtar-b39e8de9c8da4905477d142e7c7dd630864335f8.zip |
Finds: dating -> datings
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r-- | archaeological_finds/models.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 1d59c59b1..a2cea7ef3 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -204,7 +204,7 @@ WEIGHT_UNIT = (('g', _(u"g")), class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): - TABLE_COLS = ['label', 'material_types', 'dating.period', + 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', @@ -232,7 +232,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): 'index'] TABLE_COLS_FOR_OPE += [ 'previous_id', 'label', 'material_types', - 'dating.period', 'find_number', 'object_types', + 'datings.period', 'find_number', 'object_types', 'description'] TABLE_COLS_FOR_OPE_LBL = { @@ -265,8 +265,8 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): downstream_treatment = models.ForeignKey( "Treatment", blank=True, null=True, related_name='upstream_treatment', verbose_name=_("Downstream treatment")) - dating = models.ForeignKey(Dating, verbose_name=_(u"Dating"), blank=True, - null=True) + datings = models.ManyToManyField(Dating, verbose_name=_(u"Dating"), + related_name='find') if WAREHOUSE_AVAILABLE: container = models.ForeignKey( Container, verbose_name=_(u"Container"), blank=True, null=True, @@ -315,6 +315,10 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): return self.reference @property + def dating(self): + return u" ; ".join([unicode(dating) for dating in self.datings.all()]) + + @property def show_url(self): return reverse('show-find', args=[self.pk, '']) |