Zinnia API

zinnia Package

Zinnia

comparison Module

Comparison tools for Zinnia Based on clustered_models app

class zinnia.comparison.ClusteredModel(queryset, fields=['id'])

Bases: object

Wrapper around Model class building a dataset of instances

dataset()

Generate a dataset with the queryset and specified fields

class zinnia.comparison.VectorBuilder(queryset, fields)

Bases: object

Build a list of vectors based on datasets

build_dataset()

Generate whole dataset

flush()

Flush the dataset

generate_key()

Generate key for this list of vectors

zinnia.comparison.pearson_score(list1, list2)

Compute the pearson score between 2 lists of vectors

context_processors Module

Context Processors for Zinnia

zinnia.context_processors.version(request)

Adds version of Zinnia to the context

feeds Module

Feeds for Zinnia

class zinnia.feeds.AuthorEntries

Bases: zinnia.feeds.EntryFeed

Feed filtered by an author

description(obj)

Description of the feed

get_object(request, username)

Retrieve the author by his username

get_title(obj)

Title of the feed

items(obj)

Items are the published entries of the author

URL of the author

class zinnia.feeds.CategoryEntries

Bases: zinnia.feeds.EntryFeed

Feed filtered by a category

description(obj)

Description of the feed

get_object(request, path)

Retrieve the category by his path

get_title(obj)

Title of the feed

items(obj)

Items are the published entries of the category

URL of the category

class zinnia.feeds.DiscussionFeed

Bases: zinnia.feeds.ZinniaFeed

Base class for Discussion Feed

description_template = 'feeds/discussion_description.html'
item_author_email(item)

Author’s email of the discussion

Author’s URL of the discussion

item_author_name(item)

Author of the discussion

URL of the discussion

item_pubdate(item)

Publication date of a discussion

title_template = 'feeds/discussion_title.html'
class zinnia.feeds.EntryComments

Bases: zinnia.feeds.EntryDiscussions

Feed for comments in an entry

description(obj)

Description of the feed

description_template = 'feeds/comment_description.html'
get_title(obj)

Title of the feed

item_enclosure_length(item)

Hardcoded enclosure length

item_enclosure_mime_type(item)

Hardcoded enclosure mimetype

item_enclosure_url(item)

Returns a gravatar image for enclosure

URL of the comment

items(obj)

Items are the comments on the entry

title_template = 'feeds/comment_title.html'
class zinnia.feeds.EntryDiscussions

Bases: zinnia.feeds.DiscussionFeed

Feed for discussions on an entry

description(obj)

Description of the feed

get_object(request, year, month, day, slug)

Retrieve the discussions by entry’s slug

get_title(obj)

Title of the feed

items(obj)

Items are the discussions on the entry

URL of the entry

class zinnia.feeds.EntryFeed

Bases: zinnia.feeds.ZinniaFeed

Base Entry Feed

description_template = 'feeds/entry_description.html'
item_author_email(item)

Returns the first author’s email

Returns the author’s URL

item_author_name(item)

Returns the first author of an entry

item_categories(item)

Entry’s categories

item_enclosure_length(item)

Hardcoded enclosure length

item_enclosure_mime_type(item)

Hardcoded enclosure mimetype

item_enclosure_url(item)

Returns an image for enclosure

item_pubdate(item)

Publication date of an entry

title_template = 'feeds/entry_title.html'
class zinnia.feeds.EntryPingbacks

Bases: zinnia.feeds.EntryDiscussions

Feed for pingbacks in an entry

description(obj)

Description of the feed

description_template = 'feeds/pingback_description.html'
get_title(obj)

Title of the feed

URL of the pingback

items(obj)

Items are the pingbacks on the entry

title_template = 'feeds/pingback_title.html'
class zinnia.feeds.EntryTrackbacks

Bases: zinnia.feeds.EntryDiscussions

Feed for trackbacks in an entry

description(obj)

Description of the feed

description_template = 'feeds/trackback_description.html'
get_title(obj)

Title of the feed

URL of the trackback

items(obj)

Items are the trackbacks on the entry

title_template = 'feeds/trackback_title.html'
class zinnia.feeds.LatestDiscussions

Bases: zinnia.feeds.DiscussionFeed

Feed for the latest discussions

description()

Description of the feed

get_title(obj)

Title of the feed

items()

Items are the discussions on the entries

URL of latest discussions

class zinnia.feeds.LatestEntries

Bases: zinnia.feeds.EntryFeed

Feed for the latest entries

description()

Description of the feed

get_title(obj)

Title of the feed

items()

Items are published entries

URL of latest entries

class zinnia.feeds.SearchEntries

Bases: zinnia.feeds.EntryFeed

Feed filtered by a search pattern

description(obj)

Description of the feed

get_object(request)

The GET parameter ‘pattern’ is the object

get_title(obj)

Title of the feed

items(obj)

Items are the published entries founds

URL of the search request

class zinnia.feeds.TagEntries

Bases: zinnia.feeds.EntryFeed

Feed filtered by a tag

description(obj)

Description of the feed

get_object(request, slug)

Retrieve the tag by his name

get_title(obj)

Title of the feed

items(obj)

Items are the published entries of the tag

URL of the tag

class zinnia.feeds.ZinniaFeed

Bases: django.contrib.syndication.views.Feed

Base Feed class for the Zinnia application, enriched for a more convenient usage.

get_title(obj)
title(obj=None)

Title of the feed prefixed with the site name

managers Module

Managers of Zinnia

class zinnia.managers.AuthorPublishedManager

Bases: django.db.models.manager.Manager

Manager to retrieve published authors

get_query_set()

Return published authors

class zinnia.managers.EntryPublishedManager

Bases: django.db.models.manager.Manager

Manager to retrieve published entries

Advanced search on entries

Basic search on entries

get_query_set()

Return published entries

on_site()

Return entries published on current site

search(pattern)

Top level search method on entries

zinnia.managers.entries_published(queryset)

Return only the entries published

zinnia.managers.tags_published()

Return the published tags

models Module

Models of Zinnia

class zinnia.models.Author(*args, **kwargs)

Bases: django.contrib.auth.models.User

Proxy Model around User

exception DoesNotExist

Bases: django.contrib.auth.models.DoesNotExist

exception Author.MultipleObjectsReturned

Bases: django.contrib.auth.models.MultipleObjectsReturned

Author.entries_published()

Return only the entries published

Author.get_absolute_url(*moreargs, **morekwargs)

Return author’s URL

Author.objects = <django.db.models.manager.Manager object at 0x3dbea50>
Author.published = <zinnia.managers.AuthorPublishedManager object at 0x3dbea90>
class zinnia.models.Category(*args, **kwargs)

Bases: mptt.models.MPTTModel

Category object for Entry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Category.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Category.children
Category.entries
Category.entries_published()

Return only the entries published

Category.get_absolute_url(*moreargs, **morekwargs)

Return category’s URL

Category.objects = <mptt.managers.TreeManager object at 0x3dc6110>
Category.parent
Category.tree = <mptt.managers.TreeManager object at 0x3dc6110>
Category.tree_path

Return category’s tree path, by his ancestors

class zinnia.models.Entry(*args, **kwargs)

Bases: zinnia.models.EntryAbstractClass

The final Entry model based on inheritence. Check this out for customizing the Entry Model class: http://django-blog-zinnia.com/documentation/how-to/extending_entry_model/

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Entry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Entry.authors
Entry.categories
Entry.get_absolute_url(*moreargs, **morekwargs)

Return entry’s URL

Entry.get_next_by_creation_date(*moreargs, **morekwargs)
Entry.get_next_by_end_publication(*moreargs, **morekwargs)
Entry.get_next_by_last_update(*moreargs, **morekwargs)
Entry.get_next_by_start_publication(*moreargs, **morekwargs)
Entry.get_previous_by_creation_date(*moreargs, **morekwargs)
Entry.get_previous_by_end_publication(*moreargs, **morekwargs)
Entry.get_previous_by_last_update(*moreargs, **morekwargs)
Entry.get_previous_by_start_publication(*moreargs, **morekwargs)
Entry.get_status_display(*moreargs, **morekwargs)
Entry.get_template_display(*moreargs, **morekwargs)
Entry.objects = <django.db.models.manager.Manager object at 0x3dd5510>
Entry.published = <zinnia.managers.EntryPublishedManager object at 0x3dd5590>
Entry.related
Entry.sites
Entry.tags = u''
class zinnia.models.EntryAbstractClass(*args, **kwargs)

Bases: django.db.models.base.Model

Base Model design for publishing entries

class Meta

Entry’s Meta

abstract = False
get_latest_by = 'creation_date'
ordering = ['-creation_date']
permissions = (('can_view_all', 'Can view all entries'), ('can_change_status', 'Can change status'), ('can_change_author', 'Can change author(s)'))
verbose_name = <django.utils.functional.__proxy__ object at 0x3dc9690>
verbose_name_plural = <django.utils.functional.__proxy__ object at 0x3dc96d0>
EntryAbstractClass.STATUS_CHOICES = ((0, <django.utils.functional.__proxy__ object at 0x3dc6490>), (1, <django.utils.functional.__proxy__ object at 0x3dc64d0>), (2, <django.utils.functional.__proxy__ object at 0x3dc6510>))
EntryAbstractClass.authors
EntryAbstractClass.categories
EntryAbstractClass.comments

Return published comments

EntryAbstractClass.comments_are_open

Check if comments are open

EntryAbstractClass.discussions

Return published discussions

EntryAbstractClass.get_absolute_url(*args, **kwargs)

Return entry’s URL

EntryAbstractClass.get_next_by_creation_date(*moreargs, **morekwargs)
EntryAbstractClass.get_next_by_end_publication(*moreargs, **morekwargs)
EntryAbstractClass.get_next_by_last_update(*moreargs, **morekwargs)
EntryAbstractClass.get_next_by_start_publication(*moreargs, **morekwargs)
EntryAbstractClass.get_previous_by_creation_date(*moreargs, **morekwargs)
EntryAbstractClass.get_previous_by_end_publication(*moreargs, **morekwargs)
EntryAbstractClass.get_previous_by_last_update(*moreargs, **morekwargs)
EntryAbstractClass.get_previous_by_start_publication(*moreargs, **morekwargs)
EntryAbstractClass.get_status_display(*moreargs, **morekwargs)
EntryAbstractClass.get_template_display(*moreargs, **morekwargs)
EntryAbstractClass.html_content

Return the Entry.content attribute formatted in HTML

EntryAbstractClass.is_actual

Check if an entry is within publication period

EntryAbstractClass.is_visible

Check if an entry is visible on site

EntryAbstractClass.next_entry

Return the next entry

EntryAbstractClass.objects = <django.db.models.manager.Manager object at 0x3dc9610>
EntryAbstractClass.pingbacks

Return published pingbacks

EntryAbstractClass.previous_entry

Return the previous entry

EntryAbstractClass.published = <zinnia.managers.EntryPublishedManager object at 0x3dc9650>
EntryAbstractClass.related
EntryAbstractClass.related_published

Return only related entries published

EntryAbstractClass.short_url

Return the entry’s short url

EntryAbstractClass.sites
EntryAbstractClass.trackbacks

Return published trackbacks

EntryAbstractClass.word_count

Count the words of an entry

zinnia.models.get_base_model()

Determine the base Model to inherit in the Entry Model, this allow to overload it.

moderator Module

Moderator of Zinnia comments

class zinnia.moderator.EntryCommentModerator(model)

Bases: django.contrib.comments.moderation.CommentModerator

Moderate the comment of Entry

auto_close_field = 'start_publication'
auto_moderate_comments = False
close_after = None
do_email_authors(comment, content_object, request)

Send email notification of a new comment to the authors of the entry when email notifications have been requested.

do_email_notification(comment, content_object, request)

Send email notification of a new comment to site staff when email notifications have been requested.

do_email_reply(comment, content_object, request)

Send email notification of a new comment to the authors of the previous comments when email notifications have been requested.

email(comment, content_object, request)
email_authors = True
email_reply = False
enable_field = 'comment_enabled'
mail_comment_notification_recipients = []
moderate(comment, content_object, request)

Determine whether a given comment on a given object should be allowed to show up immediately, or should be marked non-public and await approval.

spam_checker_backends = ()

ping Module

Pings utilities for Zinnia

class zinnia.ping.DirectoryPinger(server_name, entries, timeout=10, start_now=True)

Bases: threading.Thread

Threaded Directory Pinger

ping_entry(entry)

Ping an entry to a Directory

run()

Ping entries to a Directory in a Thread

class zinnia.ping.ExternalUrlsPinger(entry, timeout=10, start_now=True)

Bases: threading.Thread

Threaded ExternalUrls Pinger

find_external_urls(entry)

Find external urls in an entry

find_pingback_href(content)

Try to find Link markup to pingback url

find_pingback_urls(urls)

Find the pingback urls of each urls

is_external_url(url, site_url)

Check of the url in an external url

pingback_url(server_name, target_url)

Do a pingback call for the target url

run()

Ping external URLS in a Thread

class zinnia.ping.URLRessources

Bases: object

Object defining the ressources of the website

search Module

Search module with complex query parsing for Zinnia

Parse the grammar of a pattern and build a queryset with it

zinnia.search.createQ(token)

Creates the Q() object

zinnia.search.unionQ(token)

Appends all the Q() objects

signals Module

Signal handlers of Zinnia

zinnia.signals.disable_for_loaddata(signal_handler)

Decorator for disabling signals sent by ‘post_save’ on loaddata command. http://code.djangoproject.com/ticket/8399

zinnia.signals.disconnect_zinnia_signals()

Disconnect all the signals provided by Zinnia

zinnia.signals.ping_directories_handler(*args, **kwargs)

Ping Directories when an entry is saved

zinnia.signals.ping_external_urls_handler(*args, **kwargs)

Ping Externals URLS when an entry is saved

sitemaps Module

Sitemaps for Zinnia

class zinnia.sitemaps.AuthorSitemap

Bases: django.contrib.sitemaps.Sitemap

Sitemap for authors

changefreq = 'monthly'
items()

Return published authors

lastmod(obj)

Return last modification of an author

location(obj)

Return url of an author

priority = 0.5
class zinnia.sitemaps.CategorySitemap

Bases: django.contrib.sitemaps.Sitemap

Sitemap for categories

cache(categories)

Cache categorie’s entries percent on total entries

changefreq = 'monthly'
items()

Return all categories with coeff

lastmod(obj)

Return last modification of a category

priority(obj)

Compute priority with cached coeffs

class zinnia.sitemaps.EntrySitemap

Bases: django.contrib.sitemaps.Sitemap

Sitemap for entries

changefreq = 'weekly'
items()

Return published entries

lastmod(obj)

Return last modification of an entry

priority = 0.5
class zinnia.sitemaps.TagSitemap

Bases: django.contrib.sitemaps.Sitemap

Sitemap for tags

cache(tags)

Cache tag’s entries percent on total entries

changefreq = 'monthly'
items()

Return all tags with coeff

lastmod(obj)

Return last modification of a tag

location(obj)

Return url of a tag

priority(obj)

Compute priority with cached coeffs

Project Versions

Table Of Contents

Previous topic

Template Tags

Next topic

admin Package

This Page