diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-12-04 03:29:37 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-12-04 03:29:37 +0100 |
commit | 60c4a6a718dd56083953395059c0239b84a5179a (patch) | |
tree | 4fc825b2a0dbcbabd34f542fbcc4dee7b666bc95 /archaeological_finds/models.py | |
parent | 9e04c39e156d0ab36e374d6b7d812ca49b7d3d9f (diff) | |
download | Ishtar-60c4a6a718dd56083953395059c0239b84a5179a.tar.bz2 Ishtar-60c4a6a718dd56083953395059c0239b84a5179a.zip |
Treatment modifications
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r-- | archaeological_finds/models.py | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 3e0d09ef8..a563a8404 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -794,6 +794,22 @@ post_delete.connect(post_save_cache, sender=TreatmentType) class Treatment(BaseHistorizedItem, ImageModel, OwnPerms): SHOW_URL = 'show-treatment' + TABLE_COLS = ('treatment_types_lbl', 'person', 'start_date', + 'downstream_cached_label', 'upstream_cached_label') + REVERSED_BOOL_FIELDS = ['image__isnull'] + EXTRA_REQUEST_KEYS = { + "label": 'label__icontains', + "other_reference": 'other_reference__icontains', + "treatment_types": "treatment_types__pk", + "downstream_cached_label": "downstream__cached_label", + "upstream_cached_label": "upstream__cached_label", + 'image': 'image__isnull', + } + TABLE_COLS_LBL = { + "downstream_cached_label": _(u"Downstream find"), + "upstream_cached_label": _(u"Upstream find"), + } + IMAGE_PREFIX = 'treatment' label = models.CharField(_(u"Label"), blank=True, null=True, max_length=200) other_reference = models.CharField(_(u"Other ref."), blank=True, null=True, @@ -826,16 +842,6 @@ class Treatment(BaseHistorizedItem, ImageModel, OwnPerms): blank=True, null=True) target_is_basket = models.BooleanField(_("Target a basket"), default=False) history = HistoricalRecords() - TABLE_COLS = ('treatment_type', 'person', 'start_date', - 'downstream_cached_label', 'upstream_cached_label') - EXTRA_REQUEST_KEYS = { - "downstream_cached_label": "downstream__cached_label", - "upstream_cached_label": "upstream__cached_label", - } - TABLE_COLS_LBL = { - "downstream_cached_label": _(u"Downstream find"), - "upstream_cached_label": _(u"Upstream find"), - } class Meta: verbose_name = _(u"Treatment") @@ -855,7 +861,7 @@ class Treatment(BaseHistorizedItem, ImageModel, OwnPerms): lbl += u" %s %s" % (_(u"by"), unicode(self.person)) return lbl - def treatment_type(self): + def treatment_types_lbl(self): """ Treatment types label :return: string |