summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 73f140625..c7fe7be8a 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -2057,11 +2057,23 @@ class Dashboard(object):
return v
-EXPORT_FORMATS = []
+EXPORT_FORMATS = [("", "---")]
+EXPORT_FORMATS_CONTENT_TYPE = {
+ "xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ "docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+ "pdf": "application/pdf",
+ "html": "text/html",
+ "odt": "application/vnd.oasis.opendocument.text",
+ "ods": "application/vnd.oasis.opendocument.spreadsheet",
+}
if settings.USE_LIBREOFFICE:
- EXPORT_FORMATS.append(("xlsx", _("XLSX")))
- EXPORT_FORMATS.append(("pdf", _("PDF")))
+ EXPORT_FORMATS = [
+ ("docx", _("DOCX")),
+ ("html", _("HTML")),
+ ("pdf", _("PDF")),
+ ("xlsx", _("XLSX")),
+ ]
EXPORT_FORMATS_DICT = dict(EXPORT_FORMATS)
@@ -2124,7 +2136,7 @@ class DocumentTemplate(models.Model):
def clean(self):
if self.for_labels and not self.label_per_page:
raise ValidationError(
- _("For label template, you must provide " "number of label per page.")
+ _("For label template, you must provide number of label per page.")
)
def generate_label_template(self):