Skip to main content

A way to handle one or more hierarchical category trees in django.

Project description

Django Categories grew out of our need to provide a basic hierarchical taxonomy management system that multiple applications could use independently or in concert.

As a news site, our stories, photos, and other content get divided into “sections” and we wanted all the apps to use the same set of sections. As our needs grew, the Django Categories grew in the functionality it gave to category handling within web pages.

New in 0.6

Class-based views

Works great with Django 1.3 or django-cbv

New Settings infrastructure

To be more like the Django project, we are migrating from individual CATEGORIES_* settings to a dictionary named CATEGORIES_SETTINGS. Use of the previous settings will still work but will generate a DeprecationError.

The tree’s initially expanded state is now configurable

EDITOR_TREE_INITIAL_STATE allows a collapsed or expanded value. The default is collapsed.

Optional Thumbnail field

Have a thumbnail for each category!

“Categorize” models in settings

Now you don’t have to modify the model to add a Category relationship. Use the new settings to “wire” categories to different models.

Features of the project

Multiple trees, or a single tree

You can treat all the records as a single tree, shared by all the applications. You can also treat each of the top level records as individual trees, for different apps or uses.

Easy handling of hierarchical data

We use Django MPTT to manage the data efficiently and provide the extra access functions.

Easy importation of data

Import a tree or trees of space- or tab-indented data with a Django management command.

Metadata for better SEO on web pages

Include all the metadata you want for easy inclusion on web pages.

Link uncategorized objects to a category

Attach any number of objects to a category, even if the objects themselves aren’t categorized.

Hierarchical Admin

Shows the data in typical tree form with disclosure triangles

Template Helpers

Easy ways for displaying the tree data in templates:

Show one level of a tree

All root categories or just children of a specified category

Show multiple levels

Ancestors of category, category and all children of category or a category and its children

Contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-categories-0.7.tar.gz (584.0 kB view details)

Uploaded Source

File details

Details for the file django-categories-0.7.tar.gz.

File metadata

File hashes

Hashes for django-categories-0.7.tar.gz
Algorithm Hash digest
SHA256 6e128b071d1bc3f026ad20265067fa79dbb6afa31867a97c56f3e643c7ca1c4c
MD5 e849a8bb082e6e405b2edf28518112f7
BLAKE2b-256 9abfee1c7b16b6d56ab2c58d6f9fc535169ed9f7da037e4324a0d107987e92c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page