Zinnia API¶
Contents
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
-
link
(obj)¶ 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
-
link
(obj)¶ URL of the category
-
-
class
zinnia.feeds.
DiscussionFeed
¶ Bases:
zinnia.feeds.ZinniaFeed
Base class for Discussion Feed
-
description_template
= 'feeds/discussion_description.html'¶
Author’s email of the discussion
Author’s URL of the discussion
Author of the discussion
-
item_link
(item)¶ 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
-
item_link
(item)¶ 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
-
link
(obj)¶ URL of the entry
-
-
class
zinnia.feeds.
EntryFeed
¶ Bases:
zinnia.feeds.ZinniaFeed
Base Entry Feed
-
description_template
= 'feeds/entry_description.html'¶
Returns the first author’s email
Returns the author’s URL
Returns the first author of an entry
-
item_categories
(item)¶ Entry’s categories
-
item_enclosure_length
(item)¶ Try to obtains the size of the enclosure if the image is present on the FS, otherwise returns an hardcoded value
-
item_enclosure_mime_type
(item)¶ Guesses the enclosure’s 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
-
item_link
(item)¶ 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
-
item_link
(item)¶ 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
-
link
()¶ 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
-
link
()¶ 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
-
link
(obj)¶ URL of the search request
-
managers
Module¶
Managers of Zinnia
-
class
zinnia.managers.
EntryPublishedManager
¶ Bases:
django.db.models.manager.Manager
Manager to retrieve published entries
-
advanced_search
(pattern)¶ Advanced search on entries
-
basic_search
(pattern)¶ 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
Return the published tags
markups
Module¶
Set of” markup” function to transform plain text into HTML for Zinnia. Code originally provided by django.contrib.markups
-
zinnia.markups.
markdown
(value, extensions='')¶ Markdown processing with optionally using various extensions that python-markdown supports.
-
zinnia.markups.
restructuredtext
(value, settings={})¶ RestructuredText processing with optionnally custom settings.
-
zinnia.markups.
textile
(value)¶ Textile processing.
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¶
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_reply
= False¶
-
enable_field
= 'comment_enabled'¶
-
mail_comment_notification_recipients
= []¶
-
moderate
(comment, content_object, request)¶ Determine if a new comment should be marked non-public and await approval. Return
True
to put the comment into the moderator queue, orFalse
to allow it to show up immediately.
-
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
-
zinnia.search.
advanced_search
(pattern)¶ 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 public 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'¶
-
Subpackages¶
- admin Package
- models Package
- models_bases Package
- spam_checker Package
- templatetags Package
- url_shortener Package
- urls Package
- views Package
- xmlrpc Package