defaults.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. """
  2. Default settings for the ``mezzanine.forms`` app. Each of these can be
  3. overridden in your project's settings module, just like regular
  4. Django settings. The ``editable`` argument for each controls whether
  5. the setting is editable via Django's admin.
  6. Thought should be given to how a setting is actually used before
  7. making it editable, as it may be inappropriate - for example settings
  8. that are only read during startup shouldn't be editable, since changing
  9. them would require an application reload.
  10. """
  11. from __future__ import unicode_literals
  12. from django.utils.translation import ugettext_lazy as _
  13. from mezzanine.conf import register_setting
  14. register_setting(
  15. name="FORMS_FIELD_MAX_LENGTH",
  16. description=_("Max length allowed for field values in the forms app."),
  17. editable=False,
  18. default=2000,
  19. )
  20. register_setting(
  21. name="FORMS_LABEL_MAX_LENGTH",
  22. description=_("Max length allowed for field labels in the forms app."),
  23. editable=False,
  24. default=200,
  25. )
  26. register_setting(
  27. name="FORMS_CSV_DELIMITER",
  28. description=_("Char to use as a field delimiter when exporting form "
  29. "responses as CSV."),
  30. editable=False,
  31. default=",",
  32. )
  33. register_setting(
  34. name="FORMS_UPLOAD_ROOT",
  35. description=_("Absolute path for storing file uploads for the forms app."),
  36. editable=False,
  37. default="",
  38. )
  39. register_setting(
  40. name="FORMS_EXTRA_FIELDS",
  41. description=_("Extra field types for the forms app. Should contain a "
  42. "sequence of three-item sequences, each containing the ID, dotted "
  43. "import path for the field class, and field name, for each custom "
  44. "field type. The ID is simply a numeric constant for the field, "
  45. "but cannot be a value already used, so choose a high number such "
  46. "as 100 or greater to avoid conflicts."),
  47. editable=False,
  48. default=(),
  49. )
  50. register_setting(
  51. name="FORMS_EXTRA_WIDGETS",
  52. description=_("Extra field widgets for the forms app. Should contain a "
  53. "sequence of two-item sequences, each containing an existing ID "
  54. "for a form field, and a dotted import path for the widget class."),
  55. editable=False,
  56. default=(),
  57. )