diff options
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r-- | archaeological_finds/models_treatments.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 0f8b4796a..76b9a2d86 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -57,9 +57,20 @@ post_save.connect(post_save_cache, sender=TreatmentType) post_delete.connect(post_save_cache, sender=TreatmentType) +class TreatmentState(GeneralType): + class Meta: + verbose_name = _(u"Type of treatment state") + verbose_name_plural = _(u"Type of treatment states") + ordering = ('label',) +post_save.connect(post_save_cache, sender=TreatmentState) +post_delete.connect(post_save_cache, sender=TreatmentState) + + class Treatment(BaseHistorizedItem, ImageModel, OwnPerms): SHOW_URL = 'show-treatment' - TABLE_COLS = ('year', 'index', 'treatment_types__label', 'label', 'person', + TABLE_COLS = ('year', 'index', 'treatment_types__label', + 'treatment_state__label', + 'label', 'person', 'start_date', 'downstream_cached_label', 'upstream_cached_label') REVERSED_BOOL_FIELDS = ['image__isnull'] @@ -87,6 +98,9 @@ class Treatment(BaseHistorizedItem, ImageModel, OwnPerms): blank=True, null=True) treatment_types = models.ManyToManyField( TreatmentType, verbose_name=_(u"Treatment type")) + treatment_state = models.ForeignKey( + TreatmentState, verbose_name=_(u"State"), blank=True, null=True, + ) location = models.ForeignKey( Warehouse, verbose_name=_(u"Location"), blank=True, null=True, help_text=_( |