summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-10-07 17:12:17 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-10-07 17:39:17 +0200
commit2f526ba22f183ef744cfd7ac7284585f8b318d95 (patch)
tree7012a072ea14253e1baee745728d75b4c136eaa7 /ishtar_common/models.py
parentb0372619f003b5ca8f007b93c9839a62f23ab4fb (diff)
downloadIshtar-2f526ba22f183ef744cfd7ac7284585f8b318d95.tar.bz2
Ishtar-2f526ba22f183ef744cfd7ac7284585f8b318d95.zip
✨ Importer type: add default number of line to skip for CSV - 🗃️ DB: export types for templates
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index a827fa902..73f140625 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -2057,6 +2057,15 @@ class Dashboard(object):
return v
+EXPORT_FORMATS = []
+
+if settings.USE_LIBREOFFICE:
+ EXPORT_FORMATS.append(("xlsx", _("XLSX")))
+ EXPORT_FORMATS.append(("pdf", _("PDF")))
+
+EXPORT_FORMATS_DICT = dict(EXPORT_FORMATS)
+
+
class DocumentTemplate(models.Model):
name = models.CharField(_("Name"), max_length=100)
slug = models.SlugField(_("Slug"), max_length=100, unique=True)
@@ -2068,6 +2077,7 @@ class DocumentTemplate(models.Model):
null=True,
help_text=max_size_help(),
)
+ export_format = models.CharField(_("Export format"), max_length=4, choices=EXPORT_FORMATS, blank=True, default="")
label_template = models.FileField(
_("Base template for labels"),
upload_to="templates/%Y/",