update librarian
[redakcja.git] / apps / forms_builder / forms / settings.py
1 from __future__ import unicode_literals
2
3 from django.conf import settings
4 from django.core.exceptions import ImproperlyConfigured
5
6
7 if not (getattr(settings, "SITE_ID") and
8         "django.contrib.sites" in settings.INSTALLED_APPS):
9     raise ImproperlyConfigured("django.contrib.sites is required")
10
11
12 # The maximum allowed length for field values.
13 FIELD_MAX_LENGTH = getattr(settings, "FORMS_BUILDER_FIELD_MAX_LENGTH", 2000)
14
15 # The maximum allowed length for field labels.
16 LABEL_MAX_LENGTH = getattr(settings, "FORMS_BUILDER_LABEL_MAX_LENGTH", 200)
17
18 # Sequence of custom fields that will be added to the form field types.
19 EXTRA_FIELDS = getattr(settings, "FORMS_BUILDER_EXTRA_FIELDS", ())
20
21 # Sequence of custom widgets that will add/update form fields widgets.
22 EXTRA_WIDGETS = getattr(settings, "FORMS_BUILDER_EXTRA_WIDGETS", ())
23
24 # The absolute path where files will be uploaded to.
25 UPLOAD_ROOT = getattr(settings, "FORMS_BUILDER_UPLOAD_ROOT", None)
26
27 # Boolean controlling whether HTML5 form fields are used.
28 USE_HTML5 = getattr(settings, "FORMS_BUILDER_USE_HTML5", True)
29
30 # Boolean controlling whether forms are associated to Django's Sites framework.
31 USE_SITES = getattr(settings, "FORMS_BUILDER_USE_SITES", False)
32
33 # Boolean controlling whether form slugs are editable in the admin.
34 EDITABLE_SLUGS = getattr(settings, "FORMS_BUILDER_EDITABLE_SLUGS", False)
35
36 # Char to start a quoted choice with.
37 CHOICES_QUOTE = getattr(settings, "FORMS_BUILDER_CHOICES_QUOTE", "`")
38
39 # Char to end a quoted choice with.
40 CHOICES_UNQUOTE = getattr(settings, "FORMS_BUILDER_CHOICES_UNQUOTE", "`")
41
42 # Char to use as a field delimiter when exporting form responses as CSV.
43 CSV_DELIMITER = getattr(settings, "FORMS_BUILDER_CSV_DELIMITER", ",")
44
45 # The maximum allowed length for field help text
46 HELPTEXT_MAX_LENGTH = getattr(settings, "FORMS_BUILDER_HELPTEXT_MAX_LENGTH", 100)
47
48 # The maximum allowed length for field choices
49 CHOICES_MAX_LENGTH = getattr(settings, "FORMS_BUILDER_CHOICES_MAX_LENGTH", 1000)
50
51 # Does sending emails fail silently or raise an exception.
52 EMAIL_FAIL_SILENTLY = getattr(settings, "FORMS_BUILDER_EMAIL_FAIL_SILENTLY",
53                               settings.DEBUG)
54
55 # Django SITE_ID - need a default since no longer provided in settings.py.
56 SITE_ID = getattr(settings, "SITE_ID", 1)