django-articleappkit v0.1 documentation
Table of Contents
This is the core model and basis for all management. It includes the basic fields.
Required CharField(255)
The title or headline of the item.
CharField(255)
An optional subtitle or subheadline for the item.
Required SlugField
URL-friendly title. It is automatically generated from the title.
TextField
Is this item active. If it is inactive, all children are set to inactive as well.
Required TextField
The primary content of the item. The “article” of ArticleBase.
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 AUTHOR_MODEL_LIMIT setting.
In your custom Admin class, you may want to include this field in raw_id_fields to reduce load time.
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 AUTHOR_MODEL_LIMIT setting.
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.
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.
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.
IntegerField
A private field for keeping track of the key image’s width. This field is auto-populated when the record is saved.
IntegerField
A private field for keeping track of the key image’s height. This field is auto-populated when the record is saved.
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:
Required IntegerField
The current state of the article.
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.
TimeField
The time in which the article was or will be 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.
A subclass of Manager that adds a PubWorkflowManager.published() method.