views Package

views Package

Views for Zinnia

authors Module

Views for Zinnia authors

class zinnia.views.authors.AuthorDetail(**kwargs)

Bases: zinnia.views.mixins.templates.EntryQuerysetTemplateResponseMixin, django.views.generic.list.BaseListView

Display the entries of an author

get_context_data(**kwargs)

Add the current author in context

get_model_name()

The model name is the author’s username

get_queryset()

Return a queryset of entries published belonging to the current author

model_type = 'author'
paginate_by = 10
class zinnia.views.authors.AuthorList(**kwargs)

Bases: zinnia.views.mixins.callable_queryset.CallableQuerysetMixin, django.views.generic.list.ListView

View returning a list of all published authors

classmethod queryset()

archives Module

Views for Zinnia archives

class zinnia.views.archives.EntryArchiveMixin

Bases: zinnia.views.mixins.archives.ArchiveMixin, zinnia.views.mixins.archives.PreviousNextPublishedMixin, zinnia.views.mixins.callable_queryset.CallableQuerysetMixin, zinnia.views.mixins.templates.EntryQuerysetArchiveTemplateResponseMixin

Mixin combinating:

  • ArchiveMixin configuration centralizing conf for archive views
  • PreviousNextPublishedMixin for returning published archives
  • CallableQueryMixin to force the update of the queryset
  • EntryQuerysetArchiveTemplateResponseMixin to provide a custom templates for archives
classmethod queryset()
class zinnia.views.archives.EntryDay(**kwargs)

Bases: zinnia.views.mixins.tz_fixes.EntryDayTZFix, zinnia.views.archives.EntryArchiveMixin, django.views.generic.dates.BaseDayArchiveView

View returning the archive for a day

template_name_suffix = '_archive_day'
class zinnia.views.archives.EntryIndex(**kwargs)

Bases: zinnia.views.archives.EntryArchiveMixin, zinnia.views.mixins.templates.EntryQuerysetArchiveTodayTemplateResponseMixin, django.views.generic.dates.BaseArchiveIndexView

View returning the archive index

context_object_name = 'entry_list'
class zinnia.views.archives.EntryMonth(**kwargs)

Bases: zinnia.views.mixins.tz_fixes.EntryMonthTZFix, zinnia.views.archives.EntryArchiveMixin, django.views.generic.dates.BaseMonthArchiveView

View returning the archive for a month

template_name_suffix = '_archive_month'
class zinnia.views.archives.EntryToday(**kwargs)

Bases: zinnia.views.mixins.tz_fixes.EntryDayTZFix, zinnia.views.archives.EntryArchiveMixin, django.views.generic.dates.BaseTodayArchiveView

View returning the archive for the current day

get_dated_items()

Return (date_list, items, extra_context) for this request. And defines self.year/month/day for EntryQuerysetArchiveTemplateResponseMixin.

template_name_suffix = '_archive_today'
class zinnia.views.archives.EntryWeek(**kwargs)

Bases: zinnia.views.mixins.tz_fixes.EntryWeekTZFix, zinnia.views.archives.EntryArchiveMixin, django.views.generic.dates.BaseWeekArchiveView

View returning the archive for a week

get_dated_items()

Override get_dated_items to add a useful ‘week_end_day’ variable in the extra context of the view

template_name_suffix = '_archive_week'
class zinnia.views.archives.EntryYear(**kwargs)

Bases: zinnia.views.archives.EntryArchiveMixin, django.views.generic.dates.BaseYearArchiveView

View returning the archive for a year

make_object_list = True
template_name_suffix = '_archive_year'

categories Module

Views for Zinnia categories

class zinnia.views.categories.CategoryDetail(**kwargs)

Bases: zinnia.views.mixins.templates.EntryQuerysetTemplateResponseMixin, django.views.generic.list.BaseListView

View returning a list of all the entries belonging to a category

get_context_data(**kwargs)

Add the current category in context

get_model_name()

The model name is the category’s slug

get_queryset()

Return a queryset of entries published belonging to the current category

model_type = 'category'
paginate_by = 10
class zinnia.views.categories.CategoryList(**kwargs)

Bases: django.views.generic.list.ListView

View returning a list of all the categories

queryset = []
zinnia.views.categories.get_category_or_404(path)

Retrieve a Category instance by a path

capabilities Module

Views for Zinnia capabilities

class zinnia.views.capabilities.CapabilityView(**kwargs)

Bases: zinnia.views.mixins.mimetypes.TemplateMimeTypeView

Base view for the weblog capabilities

get_context_data(**kwargs)

Populate the context of the template with technical informations for building urls

class zinnia.views.capabilities.HumansTxt(**kwargs)

Bases: zinnia.views.capabilities.CapabilityView

http://humanstxt.org/

mimetype = 'text/plain'
template_name = 'zinnia/humans.txt'
class zinnia.views.capabilities.OpenSearchXml(**kwargs)

Bases: zinnia.views.capabilities.CapabilityView

http://www.opensearch.org/

mimetype = 'application/opensearchdescription+xml'
template_name = 'zinnia/opensearch.xml'
class zinnia.views.capabilities.RsdXml(**kwargs)

Bases: zinnia.views.capabilities.CapabilityView

http://en.wikipedia.org/wiki/Really_Simple_Discovery

mimetype = 'application/rsd+xml'
template_name = 'zinnia/rsd.xml'
class zinnia.views.capabilities.WLWManifestXml(**kwargs)

Bases: zinnia.views.capabilities.CapabilityView

http://msdn.microsoft.com/en-us/library/bb463260.aspx

mimetype = 'application/wlwmanifest+xml'
template_name = 'zinnia/wlwmanifest.xml'

channels Module

Views for Zinnia channels

class zinnia.views.channels.EntryChannel(**kwargs)

Bases: django.views.generic.list.ListView

View for displaying a custom selection of entries based on a search pattern, useful for SEO/SMO pages

get_queryset()

Override the get_queryset method to do the search

paginate_by = 10
query = ''

entries Module

Views for Zinnia entries

class zinnia.views.entries.EntryDateDetail(**kwargs)

Bases: zinnia.views.mixins.tz_fixes.EntryDateDetailTZFix, zinnia.views.mixins.archives.ArchiveMixin, zinnia.views.mixins.templates.EntryArchiveTemplateResponseMixin, django.views.generic.dates.BaseDateDetailView

Mixin combinating:

  • ArchiveMixin configuration centralizing conf for archive views
  • EntryArchiveTemplateResponseMixin to provide a custom templates depending on the date
  • BaseDateDetailView to retrieve the entry with date and slug
  • EntryDateDetailTZFix for handing the time-zones correctly in Django 1.4.
queryset = []
class zinnia.views.entries.EntryDetail(**kwargs)

Bases: zinnia.views.mixins.entry_protection.EntryProtectionMixin, zinnia.views.entries.EntryDateDetail

Detailled view archive view for an Entry with password and login protections

mixins Module

Mixins for Zinnia views

quick_entry Module

Views for Zinnia quick entry

class zinnia.views.quick_entry.QuickEntry(**kwargs)

Bases: django.views.generic.base.View

View handling the quick post of a short Entry

dispatch(*args, **kwargs)

Decorate the view dispatcher with permission_required

get(request, *args, **kwargs)

GET only do a redirection to the admin for adding and entry

post(request, *args, **kwargs)

Handle the datas for posting a quick entry, and redirect to the admin in case of error or to the entry’s page in case of success

class zinnia.views.quick_entry.QuickEntryForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None)

Bases: django.forms.models.ModelForm

Form for posting an entry quickly

class Meta
model

alias of Entry

QuickEntryForm.base_fields = {'title': <django.forms.fields.CharField object at 0x4a682d0>, 'image': <django.forms.fields.ImageField object at 0x4a5c550>, 'content': <django.forms.fields.CharField object at 0x4a5cdd0>, 'excerpt': <django.forms.fields.CharField object at 0x4a5cc90>, 'tags': <tagging.forms.TagField object at 0x4a5c9d0>, 'categories': <django.forms.models.ModelMultipleChoiceField object at 0x4a6a210>, 'related': <django.forms.models.ModelMultipleChoiceField object at 0x4a6a610>, 'slug': <django.forms.fields.SlugField object at 0x4a6a710>, 'authors': <django.forms.models.ModelMultipleChoiceField object at 0x4a6aad0>, 'status': <django.forms.fields.TypedChoiceField object at 0x4a6abd0>, 'featured': <django.forms.fields.BooleanField object at 0x4a6ae50>, 'comment_enabled': <django.forms.fields.BooleanField object at 0x4aa3150>, 'pingback_enabled': <django.forms.fields.BooleanField object at 0x4aa3410>, 'creation_date': <django.forms.fields.DateTimeField object at 0x4aa3710>, 'last_update': <django.forms.fields.DateTimeField object at 0x4aa39d0>, 'start_publication': <django.forms.fields.DateTimeField object at 0x4aa3c90>, 'end_publication': <django.forms.fields.DateTimeField object at 0x4aa3f50>, 'sites': <django.forms.models.ModelMultipleChoiceField object at 0x4ab6310>, 'login_required': <django.forms.fields.BooleanField object at 0x4ab6610>, 'password': <django.forms.fields.CharField object at 0x4ab68d0>, 'template': <django.forms.fields.TypedChoiceField object at 0x4ab6bd0>}
QuickEntryForm.declared_fields = {}
QuickEntryForm.media

search Module

Views for Zinnia entries search

class zinnia.views.search.EntrySearch(**kwargs)

Bases: django.views.generic.list.ListView

View for searching entries

error = None
get_context_data(**kwargs)

Add error and pattern in the context

get_queryset()

Overridde the get_queryset method to do some validations and the search queryset

paginate_by = 10
pattern = ''
template_name_suffix = '_search'

sitemap Module

Views for Zinnia sitemap

class zinnia.views.sitemap.Sitemap(**kwargs)

Bases: django.views.generic.base.TemplateView

Sitemap view of the blog

get_context_data(**kwargs)

Populate the context of the template with all published entries and all the categories

template_name = 'zinnia/sitemap.html'

tags Module

Views for Zinnia tags

class zinnia.views.tags.TagDetail(**kwargs)

Bases: zinnia.views.mixins.templates.EntryQuerysetTemplateResponseMixin, django.views.generic.list.BaseListView

View return a list of all the entries published under the current tag

get_context_data(**kwargs)

Add the current tag in context

get_model_name()

The model name is the tag slugified

get_queryset()

Return a queryset of entries published belonging to the current tag

model_type = 'tag'
paginate_by = 10
class zinnia.views.tags.TagList(**kwargs)

Bases: django.views.generic.list.ListView

View return a list of all published tags

context_object_name = 'tag_list'
get_queryset()

Override the get_queryset method to compute and return the published tags

template_name = 'zinnia/tag_list.html'

trackback Module

Views for Zinnia trackback

class zinnia.views.trackback.EntryTrackback(**kwargs)

Bases: zinnia.views.mixins.mimetypes.TemplateMimeTypeView

View for handling trackbacks on the entries

dispatch(*args, **kwargs)

Decorate the view dispatcher with csrf_exempt

get(request, *args, **kwargs)

GET only do a permanent redirection to the Entry

get_object()

Retrieve the Entry trackbacked

mimetype = 'text/xml'
post(request, *args, **kwargs)

Check if an URL is provided and if trackbacks are enabled on the Entry. If so the URL is registered one time as a trackback

template_name = 'zinnia/entry_trackback.xml'