From 501c28da10afa1a95746f0b10f4b125bfee74f6a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 28 Oct 2015 00:08:29 +0100 Subject: Upgrade MCC imports fixtures --- ishtar_common/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index ddd1e5f9f..2f8bb49f9 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1319,10 +1319,19 @@ class ImporterColumn(models.Model): class Meta: verbose_name = _(u"Importer - Column") verbose_name_plural = _(u"Importer - Columns") + ordering = ('importer_type', 'col_number') + unique_together = ('importer_type', 'col_number') def __unicode__(self): return u"{} - {}".format(self.importer_type, self.col_number) + def targets_lbl(self): + return u', '.join([target.target for target in self.targets.all()]) + + def duplicate_fields_lbl(self): + return u', '.join([dp.field_name + for dp in self.duplicate_fields.all()]) + class ImporterDuplicateField(models.Model): """ -- cgit v1.2.3