diff options
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r-- | archaeological_finds/models_treatments.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index a09df554e..b35912fd0 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -286,6 +286,7 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem, return "-".join([str(slugify(getattr(self, attr))) for attr in ('year', 'index', 'label')]) + post_save.connect(cached_label_changed, sender=Treatment) @@ -302,6 +303,7 @@ def pre_delete_treatment(sender, **kwargs): find.downstream_treatment = None find.save() + pre_delete.connect(pre_delete_treatment, sender=Treatment) @@ -479,6 +481,8 @@ class TreatmentFileType(GeneralType): verbose_name = _(u"Treatment request type") verbose_name_plural = _(u"Treatment request types") ordering = ('label',) + + post_save.connect(post_save_cache, sender=TreatmentFileType) post_delete.connect(post_save_cache, sender=TreatmentFileType) @@ -488,6 +492,11 @@ class TreatmentFile(DashboardFormItem, ClosedItem, BaseHistorizedItem, SLUG = 'treatmentfile' SHOW_URL = 'show-treatmentfile' TABLE_COLS = ['type', 'year', 'index', 'internal_reference', 'name'] + BASE_SEARCH_VECTORS = [ + 'type__label', 'internal_reference', 'name', 'comment' + ] + INT_SEARCH_VECTORS = ['year', 'index'] + PARENT_SEARCH_VECTORS = ['in_charge', 'applicant', 'applicant_organisation'] SLUG = 'treatmentfile' # fields |