From 64e14a2ac5834298258d2ddf1324f6e4bb00fb5a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 8 Aug 2022 23:11:09 +0200 Subject: Import: manage CSV geo data --- ishtar_common/models_imports.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ishtar_common/models_imports.py') diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py index f7a35f849..1d987c35c 100644 --- a/ishtar_common/models_imports.py +++ b/ishtar_common/models_imports.py @@ -1153,7 +1153,8 @@ class Import(models.Model): ), ) encoding = models.CharField( - _("Encoding"), choices=ENCODINGS, default="utf-8", max_length=15 + _("Encoding"), choices=ENCODINGS, default="utf-8", max_length=15, + help_text=_("Only required for CSV file"), ) csv_sep = models.CharField( _("CSV separator"), @@ -1463,6 +1464,8 @@ class Import(models.Model): imported_file = z.extract(filename, tmp_dir) else: z.extract(filename, tmp_dir) + elif imported_file.endswith(".csv"): + return self._data_table_tab() elif not imported_file.endswith(".gpkg"): raise ImporterError(_("Invalid GIS file.")) -- cgit v1.2.3