django-articleappkit 0.3 documentation
Table of Contents
ArticleBase
¶This is the core model and basis for all management. It includes the basic fields.
title
¶Required CharField(255)
The title or headline of the item.
subtitle
¶CharField(255)
An optional subtitle or subheadline for the item.
slug
¶Required SlugField
URL-friendly title. It is automatically generated from the title
.
summary
¶TextField
Is this item active. If it is inactive, all children are set to inactive as well.
content
¶Required TextField
The primary content of the item. The “article” of ArticleBase
.
SingleAuthorMixin
¶A mixin that adds a relation to another model (typically auth.User)
ForeignKey
(
django.contrib.auth.models.User
)
The model to which this field relates is set in AUTHOR_MODEL. The default is auth.User
. You can limit the choices available using the authormodellimit_setting setting.
In your custom Admin class, you may want to include this field in raw_id_fields
to reduce load time.
MultiAuthorMixin
¶A mixin that adds a many-to-many relation to another model (typically auth.User)
ManyToManyField
(
django.contrib.auth.models.User
)
The model to which this field relates is set in AUTHOR_MODEL. The default is auth.User
. You can limit the choices available using the authormodellimit_setting setting.
NonStaffAuthorMixin
¶A mixin that adds a character field to set a one-time or non-staff author
CharField(200)
An HTML-formatted rendering of an author or authors not on staff.
KeyImageMixin
¶A mixin that allows author’s to upload a file to their article. Manages the height and width in fields and provides for a credit to the media’s author as well.
key_image
¶A custom Django FileField that uses the name of the model as the default upload_to
location. IMAGE_STORAGE allows for customization of the storage engine and IMAGE_UPLOAD_TO allows customization of the upload_to
path.
key_image_width
¶IntegerField
A private field for keeping track of the key image’s width. This field is auto-populated when the record is saved.
key_image_height
¶IntegerField
A private field for keeping track of the key image’s height. This field is auto-populated when the record is saved.
key_image_credit
¶CharField(255)
An optional field to store an attribution for the key image, if necessary
Publishing Mixins provide for a workflow, even if it is as simple as “Draft->Finished”. With a workflow, only one state is viewable on the site.
This mixin provides for a simple, linear workflow using a choice list. Four settings define crucial aspects to the workflow:
tuple
of (int, 'choice')
that defines the key, value pairings.PubWorkflowMixin
¶status
¶Required IntegerField
The current state of the article.
pub_date
¶DateField
The date in which the article was or will be published. The date and time are separated to provide support for uniqueness by date published. A datetime
value will allow multiple articles with the same slug on the same date, since the published times will likely be different.
pub_time
¶TimeField
The time in which the article was or will be published.
published
¶boolean property
The published
property allows the workflow to act like a boolean. It returns True
if the article’s PubWorkflowMixin.status
equals the PUBLISHED_STATUS.
If you set this attribute to True
, it updates its PubWorkflowMixin.pub_date
and PubWorkflowMixin.pub_time
and the PubWorkflowMixin.status
to PUBLISHED_STATUS.
If you set this attribute to False
, it updates its PubWorkflowMixin.status
to UNPUBLISHED_STATUS.
objects
¶A subclass of Manager
that adds a PubWorkflowManager.published()
method.