diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2016-01-10 15:35:51 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2016-01-10 15:35:51 +0100 |
commit | 11d7e76203e13a6d4c2a0c9aa29bd2d1dd86f5b6 (patch) | |
tree | 8d8e7c09faf179b2fed07878d1cf450a245a78d0 /ishtar_common/models.py | |
parent | 19fcd922361b045894c0eeb56e095d785299909e (diff) | |
parent | 2c063aace94e5a9f3b5dc596e4a502ef062db059 (diff) | |
download | Ishtar-11d7e76203e13a6d4c2a0c9aa29bd2d1dd86f5b6.tar.bz2 Ishtar-11d7e76203e13a6d4c2a0c9aa29bd2d1dd86f5b6.zip |
Merge branch 'master' into master-land-planner-2999
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 20b8a6f46..af1c70dce 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1539,7 +1539,8 @@ TARGET_MODELS = [ ('archaeological_finds.models.PreservationType', _(u"Preservation type")), ('archaeological_finds.models.ObjectType', _(u"Object type")), ('archaeological_context_records.models.IdentificationType', - _("Identification type")) + _("Identification type")), + ('SupportType', _(u"Support type")), ] TARGET_MODELS_KEYS = [tm[0] for tm in TARGET_MODELS] @@ -1690,8 +1691,8 @@ class Import(models.Model): verbose_name_plural = _(u"Imports") def __unicode__(self): - return u"%s - %s" % (unicode(self.importer_type), - unicode(self.user)) + return u"%s - %s - %d" % (unicode(self.importer_type), + unicode(self.user), self.pk) def need_matching(self): return bool(TargetKey.objects.filter(associated_import=self, @@ -2150,14 +2151,15 @@ class Source(models.Model): creation_date = models.DateField(blank=True, null=True, verbose_name=_(u"Creation date")) item_number = models.IntegerField(_(u"Item number"), default=1) - reference = models.CharField(_(u"Ref."), max_length=25, null=True, + reference = models.CharField(_(u"Ref."), max_length=100, null=True, blank=True) - internal_reference = models.CharField(_(u"Internal reference"), - max_length=25, null=True, blank=True) + internal_reference = models.CharField( + _(u"Internal ref."), max_length=100, null=True, blank=True) 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"), blank=True, null=True) + duplicate = models.BooleanField(_(u"Has a duplicate"), default=False) TABLE_COLS = ['title', 'source_type', 'authors', ] class Meta: @@ -2166,6 +2168,13 @@ class Source(models.Model): def __unicode__(self): return self.title + @property + def associated_filename(self): + values = [unicode(getattr(self, attr)) + for attr in ('source_type', 'title') + if getattr(self, attr)] + return slugify(u"-".join(values)) + if settings.COUNTRY == 'fr': class Arrondissement(models.Model): name = models.CharField(u"Nom", max_length=30) |