summaryrefslogtreecommitdiff
path: root/archaeological_finds/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r--archaeological_finds/models.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index b7637ba3b..a886485b5 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -793,6 +793,7 @@ post_delete.connect(post_save_cache, sender=TreatmentType)
class Treatment(BaseHistorizedItem, OwnPerms):
+ SHOW_URL = 'show-treatment'
external_id = models.CharField(_(u"External ID"), blank=True, null=True,
max_length=120)
container = models.ForeignKey(Container, verbose_name=_(u"Container"),
@@ -814,6 +815,16 @@ class Treatment(BaseHistorizedItem, OwnPerms):
start_date = models.DateField(_(u"Start date"), blank=True, null=True)
end_date = models.DateField(_(u"End date"), blank=True, null=True)
history = HistoricalRecords()
+ TABLE_COLS = ('treatment_type__label', '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")
@@ -844,10 +855,8 @@ class Treatment(BaseHistorizedItem, OwnPerms):
super(Treatment, self).save(*args, **kwargs)
if not is_new or not items:
return
- basket = None
if hasattr(items, "items"):
- basket = items
- items = basket.items.all()
+ items = items.items.all()
for item in items:
new = item.duplicate(user)
item.downstream_treatment = self