views Package¶
views Package¶
Views for Zinnia
authors Module¶
Views for Zinnia authors
Bases:
zinnia.views.mixins.templates.EntryQuerysetTemplateResponseMixin,zinnia.views.mixins.prefetch_related.PrefetchCategoriesAuthorsMixin,zinnia.views.authors.BaseAuthorDetail,django.views.generic.list.BaseListViewDetailed view for an Author combinating these mixins:
- EntryQuerysetTemplateResponseMixin to provide custom templates for the author display page.
- PrefetchCategoriesAuthorsMixin to prefetch related Categories and Authors to belonging the entry list.
- BaseAuthorDetail to provide the behavior of the view.
- BaseListView to implement the ListView.
The model name is the author’s username.
Bases:
django.views.generic.list.ListViewView returning a list of all published authors.
Return a queryset of published authors, with a count of their entries published.
Bases:
objectMixin providing the behavior of the author detail view, by returning in the context the current author and a queryset containing the entries written by author.
Add the current author in context.
Retrieve the author by his username and build a queryset of his published entries.
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.prefetch_related.PrefetchCategoriesAuthorsMixin,zinnia.views.mixins.callable_queryset.CallableQuerysetMixin,zinnia.views.mixins.templates.EntryQuerysetArchiveTemplateResponseMixinMixin combinating:
- ArchiveMixin configuration centralizing conf for archive views.
- PrefetchCategoriesAuthorsMixin to prefetch related objects.
- 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.archives.EntryArchiveMixin,django.views.generic.dates.BaseDayArchiveViewView 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.BaseArchiveIndexViewView returning the archive index.
-
context_object_name= 'entry_list'¶
-
-
class
zinnia.views.archives.EntryMonth(**kwargs)¶ Bases:
zinnia.views.archives.EntryArchiveMixin,django.views.generic.dates.BaseMonthArchiveViewView returning the archives for a month.
-
template_name_suffix= '_archive_month'¶
-
-
class
zinnia.views.archives.EntryToday(**kwargs)¶ Bases:
zinnia.views.archives.EntryArchiveMixin,django.views.generic.dates.BaseTodayArchiveViewView 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.archives.EntryArchiveMixin,django.views.generic.dates.BaseWeekArchiveViewView 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.BaseYearArchiveViewView returning the archives for a year.
-
make_object_list= True¶
-
template_name_suffix= '_archive_year'¶
-
categories Module¶
Views for Zinnia categories
-
class
zinnia.views.categories.BaseCategoryDetail¶ Bases:
objectMixin providing the behavior of the category detail view, by returning in the context the current category and a queryset containing the entries published under it.
-
get_context_data(**kwargs)¶ Add the current category in context.
-
get_queryset()¶ Retrieve the category by his path and build a queryset of her published entries.
-
-
class
zinnia.views.categories.CategoryDetail(**kwargs)¶ Bases:
zinnia.views.mixins.templates.EntryQuerysetTemplateResponseMixin,zinnia.views.mixins.prefetch_related.PrefetchCategoriesAuthorsMixin,zinnia.views.categories.BaseCategoryDetail,django.views.generic.list.BaseListViewDetailed view for a Category combinating these mixins:
- EntryQuerysetTemplateResponseMixin to provide custom templates for the category display page.
- PrefetchCategoriesAuthorsMixin to prefetch related Categories and Authors to belonging the entry list.
- BaseCategoryDetail to provide the behavior of the view.
- BaseListView to implement the ListView.
-
get_model_name()¶ The model name is the category’s slug.
-
model_type= 'category'¶
-
paginate_by= 10¶
-
class
zinnia.views.categories.CategoryList(**kwargs)¶ Bases:
django.views.generic.list.ListViewView returning a list of published categories.
-
get_queryset()¶ Return a queryset of published categories, with a count of their entries published.
-
-
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:
django.views.generic.base.TemplateViewBase 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-
content_type= 'text/plain'¶
-
template_name= 'zinnia/humans.txt'¶
-
-
class
zinnia.views.capabilities.OpenSearchXml(**kwargs)¶ Bases:
zinnia.views.capabilities.CapabilityView-
content_type= 'application/opensearchdescription+xml'¶
-
template_name= 'zinnia/opensearch.xml'¶
-
-
class
zinnia.views.capabilities.RsdXml(**kwargs)¶ Bases:
zinnia.views.capabilities.CapabilityViewhttp://en.wikipedia.org/wiki/Really_Simple_Discovery
-
content_type= 'application/rsd+xml'¶
-
template_name= 'zinnia/rsd.xml'¶
-
-
class
zinnia.views.capabilities.WLWManifestXml(**kwargs)¶ Bases:
zinnia.views.capabilities.CapabilityViewhttp://msdn.microsoft.com/en-us/library/bb463260.aspx
-
content_type= 'application/wlwmanifest+xml'¶
-
template_name= 'zinnia/wlwmanifest.xml'¶
-
channels Module¶
Views for Zinnia channels
-
class
zinnia.views.channels.BaseEntryChannel¶ Bases:
objectMixin for displaying a custom selection of entries based on a search query, useful to build SEO/SMO pages aggregating entries on a thematic or for building a custom homepage.
-
get_context_data(**kwargs)¶ Add query in context.
-
get_queryset()¶ Override the get_queryset method to build the queryset with entry matching query.
-
query= ''¶
-
-
class
zinnia.views.channels.EntryChannel(**kwargs)¶ Bases:
zinnia.views.mixins.prefetch_related.PrefetchCategoriesAuthorsMixin,zinnia.views.channels.BaseEntryChannel,django.views.generic.list.ListViewChannel view for entries combinating these mixins:
- PrefetchCategoriesAuthorsMixin to prefetch related Categories and Authors to belonging the entry list.
- BaseEntryChannel to provide the behavior of the view.
- ListView to implement the ListView and template name resolution.
-
paginate_by= 10¶
comments Module¶
Views for Zinnia comments
-
class
zinnia.views.comments.CommentSuccess(**kwargs)¶ Bases:
django.views.generic.base.TemplateResponseMixin,django.views.generic.base.ViewView for handing the publication of a Comment on an Entry. Do a redirection if the comment is visible, else render a confirmation template.
-
get(request, *args, **kwargs)¶
-
get_context_data(**kwargs)¶
-
template_name= 'comments/zinnia/entry/posted.html'¶
-
entries Module¶
Views for Zinnia entries
-
class
zinnia.views.entries.EntryDateDetail(**kwargs)¶ Bases:
zinnia.views.mixins.archives.ArchiveMixin,zinnia.views.mixins.templates.EntryArchiveTemplateResponseMixin,zinnia.views.mixins.callable_queryset.CallableQuerysetMixin,django.views.generic.dates.BaseDateDetailViewMixin 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
- CallableQueryMixin to defer the execution of the queryset property when imported
-
classmethod
queryset()¶ Return entries published on current site.
-
class
zinnia.views.entries.EntryDetail(**kwargs)¶ Bases:
zinnia.views.mixins.entry_cache.EntryCacheMixin,zinnia.views.mixins.entry_preview.EntryPreviewMixin,zinnia.views.mixins.entry_protection.EntryProtectionMixin,zinnia.views.entries.EntryDateDetailDetailled archive view for an Entry with password and login protections and restricted preview.
quick_entry Module¶
Views for Zinnia quick entry
-
class
zinnia.views.quick_entry.QuickEntry(**kwargs)¶ Bases:
django.views.generic.base.ViewView 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.
-
htmlize(content)¶ Convert to HTML the content if the MARKUP_LANGUAGE is set to HTML to optimize the rendering and avoid ugly effect in WYMEditor.
-
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.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)¶ Bases:
django.forms.models.ModelFormForm for posting an entry quickly.
-
class
Meta¶ Bases:
object-
exclude= ('comment_count', 'pingback_count', 'trackback_count')¶
-
model¶ alias of
zinnia.models.entry.Entry
-
-
base_fields= {'authors': <django.forms.models.ModelMultipleChoiceField object>, 'categories': <django.forms.models.ModelMultipleChoiceField object>, 'comment_enabled': <django.forms.fields.BooleanField object>, 'content': <django.forms.fields.CharField object>, 'content_template': <django.forms.fields.TypedChoiceField object>, 'creation_date': <django.forms.fields.DateTimeField object>, 'detail_template': <django.forms.fields.TypedChoiceField object>, 'end_publication': <django.forms.fields.DateTimeField object>, 'excerpt': <django.forms.fields.CharField object>, 'featured': <django.forms.fields.BooleanField object>, 'image': <django.forms.fields.ImageField object>, 'image_caption': <django.forms.fields.CharField object>, 'last_update': <django.forms.fields.DateTimeField object>, 'lead': <django.forms.fields.CharField object>, 'login_required': <django.forms.fields.BooleanField object>, 'password': <django.forms.fields.CharField object>, 'pingback_enabled': <django.forms.fields.BooleanField object>, 'publication_date': <django.forms.fields.DateTimeField object>, 'related': <django.forms.models.ModelMultipleChoiceField object>, 'sites': <django.forms.models.ModelMultipleChoiceField object>, 'slug': <django.forms.fields.SlugField object>, 'start_publication': <django.forms.fields.DateTimeField object>, 'status': <django.forms.fields.TypedChoiceField object>, 'tags': <tagging.forms.TagField object>, 'title': <django.forms.fields.CharField object>, 'trackback_enabled': <django.forms.fields.BooleanField object>}¶
-
declared_fields= {}¶
-
media¶
-
class
search Module¶
Views for Zinnia entries search
-
class
zinnia.views.search.BaseEntrySearch¶ Bases:
objectMixin providing the behavior of the entry search view, by returning in the context the pattern searched, the error if something wrong has happened and finally the the queryset of published entries matching the pattern.
-
error= None¶
-
get_context_data(**kwargs)¶ Add error and pattern in context.
-
get_queryset()¶ Overridde the get_queryset method to do some validations and build the search queryset.
-
pattern= ''¶
-
-
class
zinnia.views.search.EntrySearch(**kwargs)¶ Bases:
zinnia.views.mixins.prefetch_related.PrefetchCategoriesAuthorsMixin,zinnia.views.search.BaseEntrySearch,django.views.generic.list.ListViewSearch view for entries combinating these mixins:
- PrefetchCategoriesAuthorsMixin to prefetch related Categories and Authors to belonging the entry list.
- BaseEntrySearch to provide the behavior of the view.
- ListView to implement the ListView and template name resolution.
-
paginate_by= 10¶
-
template_name_suffix= '_search'¶
sitemap Module¶
Views for Zinnia sitemap
-
class
zinnia.views.sitemap.Sitemap(**kwargs)¶ Bases:
django.views.generic.base.TemplateViewSitemap view of the Weblog.
-
get_context_data(**kwargs)¶ Populate the context of the template with all published entries and all the categories.
-
template_name= 'zinnia/sitemap.html'¶
-
shortlink Module¶
Views for Zinnia shortlink
-
class
zinnia.views.shortlink.EntryShortLink(**kwargs)¶ Bases:
django.views.generic.base.RedirectViewView for handling the shortlink of an Entry, simply do a redirection.
-
get_redirect_url(**kwargs)¶ Get entry corresponding to ‘pk’ encoded in base36 in the ‘token’ variable and return the get_absolute_url of the entry.
-
permanent= True¶
-
tags Module¶
Views for Zinnia tags
Bases:
objectMixin providing the behavior of the tag detail view, by returning in the context the current tag and a queryset containing the entries published with the tag.
Add the current tag in context.
Retrieve the tag by his name and build a queryset of his published entries.
Bases:
zinnia.views.mixins.templates.EntryQuerysetTemplateResponseMixin,zinnia.views.mixins.prefetch_related.PrefetchCategoriesAuthorsMixin,zinnia.views.tags.BaseTagDetail,django.views.generic.list.BaseListViewDetailed view for a Tag combinating these mixins:
- EntryQuerysetTemplateResponseMixin to provide custom templates for the tag display page.
- PrefetchCategoriesAuthorsMixin to prefetch related Categories and Authors to belonging the entry list.
- BaseTagDetail to provide the behavior of the view.
- BaseListView to implement the ListView.
The model name is the tag slugified.
Bases:
django.views.generic.list.ListViewView return a list of all published tags.
Return a queryset of published tags, with a count of their entries published.
trackback Module¶
Views for Zinnia trackback
-
class
zinnia.views.trackback.EntryTrackback(**kwargs)¶ Bases:
django.views.generic.base.TemplateViewView for handling trackbacks on the entries.
-
content_type= 'text/xml'¶
-
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.
-
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'¶
-