contact_form.models: 8 total statements, 100.0% covered

Generated: Wed 2014-02-05 16:32 CET

Source file: /home/dkaufhold/projects/bitmazk-contact-form/src/contact_form/models.py

Stats: 3 executed, 0 missed, 5 excluded, 21 ignored

  1. """Models for the ``contact_form`` app."""
  2. from django.db import models
  3. from django.utils.translation import ugettext_lazy as _
  4. from hvad.models import TranslatableModel, TranslatedFields
  5. class ContactFormCategory(TranslatableModel):
  6. """
  7. The category of the users contact request.
  8. Is created as translatable master data by the admin.
  9. For translatable fields check the ``ContactFormCategoryTranslation`` model.
  10. """
  11. slug = models.SlugField(
  12. max_length=256,
  13. verbose_name=_('Slug'),
  14. )
  15. translations = TranslatedFields(
  16. name=models.CharField(
  17. max_length=256,
  18. verbose_name=_('Name'),
  19. )
  20. )
  21. def __unicode__(self):
  22. return self.slug
  23. # return self.safe_translation_getter('name', self.slug)