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, tag)

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)
site
site_url
title(obj=None)

Title of the feed prefixed with the site name

managers Module

Managers of Zinnia

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

class zinnia.managers.EntryRelatedPublishedManager

Bases: django.db.models.manager.Manager

Manager to retrieve objects associated with published entries

get_query_set()

Return a queryset containing published entries

zinnia.managers.entries_published(queryset)

Return only the entries published

zinnia.managers.tags_published()

Return the published tags

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.connect_discussion_signals()

Connect all the signals on the Comment model to maintains a valid discussion count on each entries when an action is done with the comments.

zinnia.signals.connect_entry_signals()

Connect all the signals on Entry model.

zinnia.signals.count_comments_handler(sender, **kwargs)

Update Entry.comment_count when a comment was posted.

zinnia.signals.count_discussions_handler(sender, **kwargs)

Update the count of each type of discussion on an entry.

zinnia.signals.count_pingbacks_handler(sender, **kwargs)

Update Entry.pingback_count when a pingback was posted.

zinnia.signals.count_trackbacks_handler(sender, **kwargs)

Update Entry.trackback_count when a trackback was posted.

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

Disconnect all the signals on Comment model provided by Zinnia.

zinnia.signals.disconnect_entry_signals()

Disconnect all the signals on Entry model.

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: zinnia.sitemaps.EntryRelatedSitemap

Sitemap for authors

model

alias of Author

class zinnia.sitemaps.CategorySitemap

Bases: zinnia.sitemaps.EntryRelatedSitemap

Sitemap for categories

model

alias of Category

class zinnia.sitemaps.EntryRelatedSitemap

Bases: zinnia.sitemaps.ZinniaSitemap

Sitemap for models related to Entries

cache_infos(queryset)

Cache infos like the number of entries published and the last modification date for standardized access later.

changefreq = 'monthly'
get_queryset()

Build a queryset of items with published entries and annotated with the number of entries and the latest modification date.

items()

Get a queryset, cache infos for standardized access to them later then compute the maximum of entries to define the priority of each items.

lastmod(item)

The last modification date is defined by the latest entries last update in the cache.

model = None
priority(item)

The priority of the item depends of the number of entries published in the cache divided by the maximum of entries.

set_max_entries()

Define the maximum of entries for computing the priority of each items later.

class zinnia.sitemaps.EntrySitemap

Bases: zinnia.sitemaps.ZinniaSitemap

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: zinnia.sitemaps.EntryRelatedSitemap

Sitemap for tags

cache_infos(queryset)

Cache the number of entries published and the last modification date under each tag.

get_queryset()

Return the published Tags with option counts.

location(item)

Return URL of the Tag

class zinnia.sitemaps.ZinniaSitemap

Bases: django.contrib.sitemaps.Sitemap

Base Sitemap class for Zinnia

protocol = 'http'

Project Versions

Table Of Contents

Previous topic

Template Tags

Next topic

admin Package

This Page