Django Categories v1.1 documentation
TreeForeignKey (self)
The category’s parent category. Leave this blank for an root category.
Required CharField(100)
The name of the category.
Required SlugField
URL-friendly title. It is automatically generated from the title.
Required BooleanField default: True
Is this item active. If it is inactive, all children are set to inactive as well.
CategoryManager
An object manager that adds an active method for only selecting items whose active attribute is True.
TreeManager
A Django-MPTT TreeManager instance.
Category is a subclass of CategoryBase and includes all its attributes.
FileField
An optional thumbnail, that is uploaded to REGISTER_ADMIN via THUMBNAIL_STORAGE.
Note
Why isn’t this an ImageField?
For ImageFields, Django checks the file system for the existance of the files to handle the height and width. In many cases this can lead to problems and impact performance.
For these reasons, a FileField that manually manages the width and height was chosen.
IntegerField
The thumbnail width. Automatically set on save if a thumbnail is uploaded.
IntegerField
The thumbnail height. Automatically set on save if a thumbnail is uploaded.
Required IntegerField default: 0
A manually-managed order of this category in the listing. Items with the same order are sorted alphabetically.
CharField(100)
An alternative title to use on pages with this category.
CharField(200)
An alternative URL to use instead of the one derived from the category hierarchy.
Note
Why isn’t this a URLField?
For URLFields, Django checks that the URL includes http:// and the site name. This makes it impossible to use relative URLs in that field.
TextField
An optional longer description of the category. Very useful on category landing pages.
CharField(255)
Comma-separated keywords for search engines.
TextField
(Advanced) Any additional HTML to be placed verbatim in the <head> of the page.