diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-05-14 16:02:33 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:20 +0100 | 
| commit | ab904ea992264f868f549af5deadc81534956dfb (patch) | |
| tree | 63d6dbce538def79fc2a007a6c841427ede69a05 /ishtar_common/models.py | |
| parent | 3f6f46ef90982829852f345468666e75f0671d71 (diff) | |
| download | Ishtar-ab904ea992264f868f549af5deadc81534956dfb.tar.bz2 Ishtar-ab904ea992264f868f549af5deadc81534956dfb.zip | |
Documents - add format, scale, associated containers
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 6eea042ce..4b9253b03 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -5525,6 +5525,15 @@ class Document(BaseHistorizedItem, QRCodeItem, OwnPerms, ImageModel,          verbose_name=_("Receipt date in documentation"))      item_number = models.IntegerField(_("Number of items"), default=1)      description = models.TextField(_("Description"), blank=True, null=True) +    container = models.ForeignKey( +        "archaeological_warehouse.Container", verbose_name=_("Container"), +        blank=True, null=True, related_name='contained_documents', +        on_delete=models.SET_NULL) +    container_ref = models.ForeignKey( +        "archaeological_warehouse.Container", +        verbose_name=_("Reference container"), +        blank=True, null=True, +        related_name='contained_documents_ref', on_delete=models.SET_NULL)      comment = models.TextField(_("Comment"), blank=True, null=True)      additional_information = models.TextField(_("Additional information"),                                                blank=True, null=True) @@ -5573,6 +5582,15 @@ class Document(BaseHistorizedItem, QRCodeItem, OwnPerms, ImageModel,      def duplicate_item(self, user=None, data=None):          return duplicate_item(self, user, data) +    @property +    def source_type_html(self): +        source_types = [] +        source_type = self.source_type +        while source_type: +            source_types.append(str(source_type)) +            source_type = source_type.parent +        return " / ".join(reversed(source_types)) +      def public_representation(self):          site = Site.objects.get_current()          if settings.ISHTAR_SECURE: | 
