contact_form.models: 8 total statements, 100.0% covered

Generated: Tue 2014-01-21 12:27 CET

Source file: /home/tobi/Projects/bitmazk-contact-form/src/contact_form/models.py

Stats: 3 executed, 0 missed, 5 excluded, 18 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(max_length=256),
  17. )
  18. def __unicode__(self):
  19. return self.lazy_translation_getter('name', 'Untranslated')