mixins Package¶
mixins
Package¶
Mixins for Zinnia views
archives
Module¶
Mixins for Zinnia archive views
-
class
zinnia.views.mixins.archives.
ArchiveMixin
¶ Bases:
object
Mixin centralizing the configuration of the archives views
-
allow_empty
= True¶
-
allow_future
= True¶
-
date_field
= 'creation_date'¶
-
month_format
= '%m'¶
-
paginate_by
= 10¶
-
week_format
= '%W'¶
-
-
class
zinnia.views.mixins.archives.
PreviousNextPublishedMixin
¶ Bases:
object
Mixin for correcting the previous/next context variable to return dates with published datas
-
get_next_day
(date)¶ Get the next day with published Entries
-
get_next_month
(date)¶ Get the next month with published Entries
-
get_next_year
(date)¶ Get the next year with published Entries
-
get_previous_day
(date)¶ Get the previous day with published Entries
-
get_previous_month
(date)¶ Get the previous month with published Entries
-
get_previous_next_published
(date, period, previous=True)¶ Return the next or previous published date period with Entries
-
get_previous_year
(date)¶ Get the previous year with published Entries
-
callable_queryset
Module¶
Callable Queryset mixins for Zinnia views
-
class
zinnia.views.mixins.callable_queryset.
CallableQuerysetMixin
¶ Bases:
object
Mixin for handling a callable queryset. Who will force the update of the queryset. Related to issue http://code.djangoproject.com/ticket/8378
-
get_queryset
()¶ Check that the queryset is defined and call it
-
queryset
= None¶
-
entry_protection
Module¶
Protection mixins for Zinnia views
-
class
zinnia.views.mixins.entry_protection.
EntryProtectionMixin
¶ Bases:
object
Mixin returning a login view if the current entry need authentication and password view if the entry is protected by a password
-
error
= False¶
-
get
(request, *args, **kwargs)¶ Do the login protection
-
login
()¶ Return the login view
-
password
()¶ Return the password form
-
post
(request, *args, **kwargs)¶ Do the login protection
-
session_key
= 'zinnia_entry_%s_password'¶
-
templates
Module¶
Template mixins for Zinnia views
-
class
zinnia.views.mixins.templates.
EntryArchiveTemplateResponseMixin
¶ Bases:
zinnia.views.mixins.templates.EntryQuerysetArchiveTemplateResponseMixin
Same as EntryQuerysetArchivetemplateResponseMixin but use the template defined in the Entry instance as the base template name.
-
get_default_base_template_names
()¶ Return the Entry.template value
-
-
class
zinnia.views.mixins.templates.
EntryQuerysetArchiveTemplateResponseMixin
¶ Bases:
django.views.generic.base.TemplateResponseMixin
Return a custom template name for the archive views based on the type of the archives and the value of the date.
-
get_archive_part_value
(part)¶ Method for accessing to the value of self.get_year(), self.get_month(), etc methods if they exists.
-
get_default_base_template_names
()¶ Return a list of default base templates used to build the full list of templates.
-
get_template_names
()¶ Return a list of template names to be used for the view
-
template_name_suffix
= u'_archive'¶
-
-
class
zinnia.views.mixins.templates.
EntryQuerysetArchiveTodayTemplateResponseMixin
¶ Bases:
zinnia.views.mixins.templates.EntryQuerysetArchiveTemplateResponseMixin
Same as EntryQuerysetArchivetemplateResponseMixin but use the current date of the day when getting archive part values
-
get_archive_part_value
(part)¶ Return archive part for today
-
today
= None¶
-
-
class
zinnia.views.mixins.templates.
EntryQuerysetTemplateResponseMixin
¶ Bases:
django.views.generic.base.TemplateResponseMixin
Return a custom template name for views returning a queryset of Entry filtered by another model.
-
get_model_name
()¶ Return the model name for templates
-
get_model_type
()¶ Return the model type for templates
-
get_template_names
()¶ Return a list of template names to be used for the view
-
model_name
= None¶
-
model_type
= None¶
-