From 7b22e70da44e3d725d3830a937dd58ef0b4a742e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 13 Mar 2017 12:16:20 +0100 Subject: Imports: add a name (refs #3452) --- ishtar_common/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index a2341abdc..3b3f9d141 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2276,6 +2276,8 @@ ENCODINGS = [(settings.ENCODING, settings.ENCODING), class Import(models.Model): user = models.ForeignKey('IshtarUser') + name = models.CharField(_(u"Name"), max_length=500, + blank=True, null=True) importer_type = models.ForeignKey(ImporterType) imported_file = models.FileField( _(u"Imported file"), upload_to="upload/imports/", max_length=220) @@ -2313,8 +2315,7 @@ class Import(models.Model): verbose_name_plural = _(u"Imports") def __unicode__(self): - return u"%s - %s - %d" % (unicode(self.importer_type), - unicode(self.user), self.pk) + return u"{} | {}".format(self.name or u"-", self.importer_type) def need_matching(self): return bool(TargetKey.objects.filter(associated_import=self, -- cgit v1.2.3