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.
LanguageMixinhelps with that.
- class feincms3.mixins.MenuMixin(*args, **kwargs)[source]¶
The
MenuMixinis 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
menufrom theMENUSclass variable. This method is a receiver of Django’sclass_preparedsignal.
- class feincms3.mixins.RedirectMixin(*args, **kwargs)[source]¶
The
RedirectMixinallows 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
TemplateMixinprovides a ready-made solution for selecting django-content-editorTemplateinstances through Django’s administration interface.Warning
You are encouraged to use the PageTypeMixin and TemplateType from
feincms3.applicationsinstead.- static fill_template_key_choices(sender, **kwargs)[source]¶
Fills in the choices for
menufrom theMENUSclass variable. This method is a receiver of Django’sclass_preparedsignal.
- property regions¶
Return the selected template instances’
regionsattribute, falling back to an empty list if no template instance could be found.
- property template¶
Return the selected template instance if the
template_keyfield matches, or falls back to the first template inTEMPLATES.