Mixins (feincms3.mixins
)¶
- class feincms3.mixins.LanguageAndTranslationOfMixin(*args, **kwargs)[source]¶
This object not only has a language, it may also be a translation of another object.
- clean_fields(exclude=None)[source]¶
Implement the following validation rules:
Objects in the primary language cannot be the translation of another object
Objects in other languages can only reference objects in the primary language (this is automatically verified by Django because we’re using
limit_choices_to
)
- class feincms3.mixins.LanguageMixin(*args, **kwargs)[source]¶
Pages may come in varying languages.
LanguageMixin
helps with that.
- class feincms3.mixins.MenuMixin(*args, **kwargs)[source]¶
The
MenuMixin
is most useful on pages where there are menus with differing content on a single page, for example the main navigation and a meta navigation (containing contact, imprint etc.)Fills in the choices for
menu
from theMENUS
class variable. This method is a receiver of Django’sclass_prepared
signal.
- class feincms3.mixins.RedirectMixin(*args, **kwargs)[source]¶
The
RedirectMixin
allows adding redirects in the page tree.
- class feincms3.mixins.TemplateMixin(*args, **kwargs)[source]¶
It is sometimes useful to have different templates for CMS models such as pages, articles or anything comparable. The
TemplateMixin
provides a ready-made solution for selecting django-content-editorTemplate
instances through Django’s administration interface.Warning
You are encouraged to use the PageTypeMixin and TemplateType from
feincms3.applications
instead.- static fill_template_key_choices(sender, **kwargs)[source]¶
Fills in the choices for
menu
from theMENUS
class variable. This method is a receiver of Django’sclass_prepared
signal.
- property regions¶
Return the selected template instances’
regions
attribute, falling back to an empty list if no template instance could be found.
- property template¶
Return the selected template instance if the
template_key
field matches, or falls back to the first template inTEMPLATES
.