summaryrefslogtreecommitdiff
path: root/archaeological_finds/models_treatments.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/models_treatments.py')
-rw-r--r--archaeological_finds/models_treatments.py39
1 files changed, 38 insertions, 1 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index 52db8cabe..2a19957c8 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -70,7 +70,8 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem,
SHOW_URL = 'show-treatment'
TABLE_COLS = ('year', 'index', 'treatment_types__label',
'treatment_state__label',
- 'label', 'person__cached_label',
+ 'label', 'scientific_monitoring_manager__cached_label',
+ 'person__cached_label',
'start_date', 'downstream_cached_label',
'upstream_cached_label')
REVERSED_BOOL_FIELDS = ['documents__image__isnull']
@@ -78,6 +79,8 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem,
"downstream_cached_label": "downstream__cached_label",
"upstream_cached_label": "upstream__cached_label",
'person__cached_label': 'person__cached_label',
+ 'scientific_monitoring_manager__cached_label':
+ 'scientific_monitoring_manager__cached_label',
"person__pk": "person__pk", # used by dynamic_table_documents
}
COL_LABELS = {
@@ -86,6 +89,8 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem,
"treatment_types__label": _(u"Type"),
"treatment_state__label": _(u"State"),
"person__cached_label": _(u"Responsible"),
+ "scientific_monitoring_manager__cached_label": _(
+ "Scientific monitoring manager"),
}
# extra keys than can be passed to save method
EXTRA_SAVED_KEYS = ('items', 'user', 'resulting_find', 'upstream_items',
@@ -118,6 +123,10 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem,
pgettext_lazy("key for text search", "type"),
'treatment_types__label__iexact'
),
+ 'scientific_monitoring_manager': SearchAltName(
+ pgettext_lazy("key for text search", "scientific-manager"),
+ 'scientific_monitoring_manager__cached_label__iexact'
+ ),
}
ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES)
HISTORICAL_M2M = [
@@ -172,6 +181,10 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem,
person = models.ForeignKey(
Person, verbose_name=_(u"Responsible"), blank=True, null=True,
on_delete=models.SET_NULL, related_name='treatments')
+ scientific_monitoring_manager = models.ForeignKey(
+ Person, verbose_name=_('Scientific monitoring manager'), blank=True,
+ null=True, on_delete=models.SET_NULL,
+ related_name='manage_treatments')
organization = models.ForeignKey(
Organization, verbose_name=_(u"Organization"), blank=True, null=True,
on_delete=models.SET_NULL, related_name='treatments')
@@ -925,6 +938,22 @@ class TreatmentFile(DashboardFormItem, ClosedItem, DocumentItem,
pgettext_lazy("key for text search", "applicant-organisation"),
'applicant_organisation__cached_label__iexact'
),
+ 'exhibition_start_before': SearchAltName(
+ pgettext_lazy("key for text search", "exhibition-start-before"),
+ 'exhibition_start_date__lte'
+ ),
+ 'exhibition_start_after': SearchAltName(
+ pgettext_lazy("key for text search", "exhibition-start-after"),
+ 'exhibition_start_date__gte'
+ ),
+ 'exhibition_end_before': SearchAltName(
+ pgettext_lazy("key for text search", "exhibition-end-before"),
+ 'exhibition_end_date__lte'
+ ),
+ 'exhibition_end_after': SearchAltName(
+ pgettext_lazy("key for text search", "exhibition-end-after"),
+ 'exhibition_end_date__gte'
+ ),
}
ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES)
@@ -956,6 +985,14 @@ class TreatmentFile(DashboardFormItem, ClosedItem, DocumentItem,
null=True)
reception_date = models.DateField(_(u'Reception date'), blank=True,
null=True)
+ # exhibition
+ exhibition_name = models.TextField(_("Exhibition name"),
+ blank=True, null=True)
+ exhibition_start_date = models.DateField(_("Exhibition start date"),
+ blank=True, null=True)
+ exhibition_end_date = models.DateField(_("Exhibition end date"),
+ blank=True, null=True)
+
comment = models.TextField(_(u"Comment"), null=True, blank=True)
documents = models.ManyToManyField(
Document, related_name='treatment_files', verbose_name=_(u"Documents"),