diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-29 11:06:38 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-29 11:06:38 +0200 |
commit | 1bb6ecaafbc47cacc936298be54bfdaa8d6901c4 (patch) | |
tree | fdb8547554832f88ad7f25b4fec88ff6b709a9f8 /ishtar_common/models.py | |
parent | 287ca2f531cdf257245b0ea84ba6a97e4148c095 (diff) | |
download | Ishtar-1bb6ecaafbc47cacc936298be54bfdaa8d6901c4.tar.bz2 Ishtar-1bb6ecaafbc47cacc936298be54bfdaa8d6901c4.zip |
Sheet: complete images informations
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 2c8595a99..13e91a680 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3178,7 +3178,7 @@ class Document(OwnPerms, ImageModel, FullSearch): receipt_date_in_documentation = models.DateField( blank=True, null=True, verbose_name=_(u"Receipt date in documentation")) - item_number = models.IntegerField(_(u"Item number"), default=1) + item_number = models.IntegerField(_(u"Number of items"), default=1) description = models.TextField(_(u"Description"), blank=True, null=True) comment = models.TextField(_(u"Comment"), blank=True, null=True) additional_information = models.TextField(_(u"Additional information"), @@ -3220,6 +3220,12 @@ class Document(OwnPerms, ImageModel, FullSearch): """ @property + def associated_file_name(self): + if not self.associated_file: + return "" + return os.path.basename(self.associated_file.name) + + @property def images(self): # mimic a queryset pointing to himself return Document.objects.filter( |