From 898e9e306d1bca2765bf0902cb67cb9d94e03c52 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 7 Mar 2017 17:34:18 +0100 Subject: Exports: specific configuration to manage ambiguous column (refs #3446) --- ishtar_common/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 53f0871f5..5b21a9a49 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1831,6 +1831,9 @@ class ImporterType(models.Model): for field in column.duplicate_fields.all()] formater_kwargs['required'] = column.required formater_kwargs['force_new'] = force_news + if column.export_field_name: + formater_kwargs['export_field_name'] = [ + column.export_field_name] formater = ImportFormater(targets, formater_types, **formater_kwargs) LINE_FORMAT.append(formater) @@ -1952,6 +1955,11 @@ class ImporterColumn(models.Model): description = models.TextField(_("Description"), blank=True, null=True) regexp_pre_filter = models.ForeignKey("Regexp", blank=True, null=True) required = models.BooleanField(_(u"Required"), default=False) + export_field_name = models.CharField( + _(u"Export field name"), blank=True, null=True, max_length=200, + help_text=_(u"Fill this field if the field name is ambiguous for " + u"export. For instance: concatenated fields.") + ) class Meta: verbose_name = _(u"Importer - Column") -- cgit v1.2.3