summaryrefslogtreecommitdiff
path: root/ishtar_common/models_imports.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-16 20:09:34 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-16 20:09:34 +0100
commit701e27958d98542b24e4e0bbd3f9604650bd0f8c (patch)
tree75b2bf05b5896ce960165a28b9b23b4f18a593c0 /ishtar_common/models_imports.py
parentf250dc4ee10f722876c09246c8acc3f5ff213ee4 (diff)
downloadIshtar-701e27958d98542b24e4e0bbd3f9604650bd0f8c.tar.bz2
Ishtar-701e27958d98542b24e4e0bbd3f9604650bd0f8c.zip
Indication of the maximum file size in help for file fields
Diffstat (limited to 'ishtar_common/models_imports.py')
-rw-r--r--ishtar_common/models_imports.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py
index b5ce3323d..e9f0e5d9e 100644
--- a/ishtar_common/models_imports.py
+++ b/ishtar_common/models_imports.py
@@ -41,7 +41,7 @@ from django.utils.translation import ugettext_lazy as _, pgettext_lazy
from ishtar_common.utils import create_slug, \
get_all_related_m2m_objects_with_model, put_session_message, \
- put_session_var, get_session_var, num2col
+ put_session_var, get_session_var, num2col, max_size_help
from ishtar_common.data_importer import Importer, ImportFormater, \
IntegerFormater, FloatFormater, UnicodeFormater, DateFormater, \
TypeFormater, YearFormater, StrToBoolean, FileFormater, InseeFormater, \
@@ -828,10 +828,11 @@ class Import(models.Model):
name = models.CharField(_(u"Name"), max_length=500, null=True)
importer_type = models.ForeignKey(ImporterType)
imported_file = models.FileField(
- _(u"Imported file"), upload_to="upload/imports/%Y/%m/", max_length=220)
+ _(u"Imported file"), upload_to="upload/imports/%Y/%m/", max_length=220,
+ help_text=max_size_help())
imported_images = models.FileField(
_(u"Associated images (zip file)"), upload_to="upload/imports/%Y/%m/",
- blank=True, null=True, max_length=220)
+ blank=True, null=True, max_length=220, help_text=max_size_help())
associated_group = models.ForeignKey(
TargetKeyGroup, blank=True, null=True,
help_text=_(u"If a group is selected, target key saved in this group "
@@ -842,15 +843,15 @@ class Import(models.Model):
skip_lines = models.IntegerField(
_(u"Skip lines"), default=1,
help_text=_(u"Number of header lines in your file (can be 0)."))
- error_file = models.FileField(_(u"Error file"),
- upload_to="upload/imports/%Y/%m/",
- blank=True, null=True, max_length=255)
- result_file = models.FileField(_(u"Result file"),
- upload_to="upload/imports/%Y/%m/",
- blank=True, null=True, max_length=255)
- match_file = models.FileField(_(u"Match file"),
- upload_to="upload/imports/%Y/%m/",
- blank=True, null=True, max_length=255)
+ error_file = models.FileField(
+ _(u"Error file"), upload_to="upload/imports/%Y/%m/",
+ blank=True, null=True, max_length=255, help_text=max_size_help())
+ result_file = models.FileField(
+ _(u"Result file"), upload_to="upload/imports/%Y/%m/",
+ blank=True, null=True, max_length=255, help_text=max_size_help())
+ match_file = models.FileField(
+ _(u"Match file"), upload_to="upload/imports/%Y/%m/", blank=True,
+ null=True, max_length=255, help_text=max_size_help())
state = models.CharField(_(u"State"), max_length=2, choices=IMPORT_STATE,
default=u'C')
conservative_import = models.BooleanField(