diff options
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r-- | archaeological_files/models.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index a4de6e0e4..3a397e551 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -33,7 +33,7 @@ from ishtar_common.utils import cached_label_changed, get_cache, \ from ishtar_common.models import GeneralType, BaseHistorizedItem, \ HistoricalRecords, OwnPerms, Person, Organization, Department, Town, \ Dashboard, DashboardFormItem, ValueGetter, ShortMenuItem, \ - OperationType, get_external_id, post_save_cache + OperationType, get_external_id, post_save_cache, Document from archaeological_operations.models import get_values_town_related, \ ClosedItem @@ -312,6 +312,11 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, mh_listing = models.NullBooleanField( u"Sur Monument Historique inscrit", blank=True, null=True) # <-- research archaeology + + documents = models.ManyToManyField( + Document, related_name="files", verbose_name=_(u"Documents"), + blank=True) + cached_label = models.TextField(_(u"Cached name"), null=True, blank=True, db_index=True) imported_line = models.TextField(_(u"Imported line"), null=True, @@ -347,6 +352,9 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, return k return u"" + def _get_base_image_path(self): + return u"{}/{}".format(self.SLUG, self.reference or self.short_label) + @property def short_class_name(self): return _(u"FILE") |