models.py 646 B

12345678910111213141516171819202122232425
  1. from __future__ import unicode_literals
  2. from django.db import models
  3. from django.utils.translation import ugettext_lazy as _
  4. from django.utils.encoding import python_2_unicode_compatible
  5. from mezzanine.core.models import SiteRelated
  6. @python_2_unicode_compatible
  7. class Setting(SiteRelated):
  8. """
  9. Stores values for ``mezzanine.conf`` that can be edited via the admin.
  10. """
  11. name = models.CharField(max_length=50)
  12. value = models.CharField(max_length=2000)
  13. class Meta:
  14. verbose_name = _("Setting")
  15. verbose_name_plural = _("Settings")
  16. def __str__(self):
  17. return "%s: %s" % (self.name, self.value)