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_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

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'

mimetypes Module

MimeType mixins for Zinnia views

class zinnia.views.mixins.mimetypes.MimeTypeMixin

Bases: object

Mixin for handling the mimetype parameter

get_mimetype()

Return the mimetype of the response

mimetype = None
class zinnia.views.mixins.mimetypes.TemplateMimeTypeView(**kwargs)

Bases: zinnia.views.mixins.mimetypes.MimeTypeMixin, django.views.generic.base.TemplateView

TemplateView with a configurable mimetype

render_to_response(context, **kwargs)

Render the view with a custom mimetype

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 Entr instance as the base template name.

get_default_base_template_name()

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_name()

Return the default base template used to build the list of templates.

get_template_names()

Return a list of template names to be used for the view

template_name_suffix = '_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

tz_fixes Module

Mixins for fixing the time zones support in the class based generic views for archives.

This module must be removed in Django 1.5.

https://code.djangoproject.com/ticket/18217

class zinnia.views.mixins.tz_fixes.EntryDateDetailTZFix

Bases: object

get_object(queryset=None)

Get the object this request displays.

class zinnia.views.mixins.tz_fixes.EntryDayTZFix

Bases: object

class zinnia.views.mixins.tz_fixes.EntryMonthTZFix

Bases: object

get_dated_items()

Return (date_list, items, extra_context) for this request.

class zinnia.views.mixins.tz_fixes.EntryWeekTZFix

Bases: object

get_dated_items()

Return (date_list, items, extra_context) for this request.

Project Versions

Table Of Contents

Previous topic

views Package

Next topic

xmlrpc Package

This Page