Skip to main content

Django categorize content app.

Project description

Django Category

Simple category app providing category and tag models.

Travis Coveralls Release

Requirements

  1. Python 2.7, 3.5-3.7

  2. Django 1.11, 2.0, 2.1

Installation

  1. Install or add django-category to your Python path.

  2. Add category to your INSTALLED_APPS setting.

  3. This package uses django’s internal sites framework. Add django.contrib.sites to your INSTALLED_APPS setting and include the required SITE_ID = 1 (or similiar). The official docs can be found here: https://docs.djangoproject.com/en/2.1/ref/contrib/sites/.

  4. Optional: django-object-tools provides a category tree view. See https://github.com/praekelt/django-object-tools for installation instructions.

Usage

Enable categorization and/or tagging on a model by creating ManyToMany fields to the models provided by django-category, for example:

from django import models

class MyModel(models.Model):
    categories = models.ManyToManyField(
        'category.Category',
        help_text='Categorize this item.'
    )
    tags = models.ManyToManyField(
        'category.Tag',
        help_text='Tag this item.'
    )

Models

class Category

Category model to be used for categorization of content. Categories are high level constructs to be used for grouping and organizing content, thus creating a site’s table of contents.

Category.title

Short descriptive title for the category to be used for display.

Category.subtitle

Some titles may be the same and cause confusion in admin UI. A subtitle makes a distinction.

Category.slug

Short descriptive unique name to be used in urls.

Category.parent

Optional parent to allow nesting of categories.

Category.sites

Limits category scope to selected sites.

class Tag

Tag model to be used for tagging content. Tags are to be used to describe your content in more detail, in essence providing keywords associated with your content. Tags can also be seen as micro-categorization of a site’s content.

Tag.title

Short descriptive name for the tag to be used for display.

Tag.slug

Short descriptive unique name to be used in urls.

Tag.categories

Categories to which the tag belongs.

Authors

Praekelt Foundation

  • Shaun Sephton

  • Jonathan Bydendyk

  • Hedley Roos

Changelog

next

  1. String representation for Python 3.

2.0.1

  1. Django 2.1 support. The minimum supported Django version is now 1.11.

  2. Added coveralls

2.0.0

  1. Django 2 support. The minimum supported Django version is now 1.10.

1.11.0

  1. Compatibility for Python 3.5 and Django 1.11.

1.9

  1. Actual unit tests.

  2. Compatibility from Django 1.6 to 1.9.

0.1.3

  1. __unicode__ method now returns a sensible result.

0.1.2

  1. Fix tree view.

0.1.1

  1. Added sites and subtitle fields.

0.1

  1. Dependency cleanup.

0.0.6

  1. Added get_absolute_url on Category

0.0.5

  1. Use prepopulate_fields for admin interface

  2. Parent category field added

  3. South migration path created

  4. Tree view of categories and tags

0.0.4 (2011-08-24)

  1. Docs, testrunner.

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-category-2.0.1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

django_category-2.0.1-py2.py3-none-any.whl (28.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-category-2.0.1.tar.gz.

File metadata

  • Download URL: django-category-2.0.1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for django-category-2.0.1.tar.gz
Algorithm Hash digest
SHA256 ef1416843777ae1ac4ca7eed70efeff5d547f3f5ca5c2e967935552b52d81da4
MD5 cdab723b77129a3baed5835c5851a8e5
BLAKE2b-256 e5270c5efd29fdcdc5bcc847fda9e402d35f6feb527ae21e683dd694cc36bdcf

See more details on using hashes here.

Provenance

File details

Details for the file django_category-2.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: django_category-2.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for django_category-2.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 50d19b6bd655f4e4057bfc94f7e57e1e77d738e77d7172ee2f16ce5cb5aed148
MD5 128c62d312754565e7d2f888b6c67a87
BLAKE2b-256 7188febbc335e8cd1383270a6ead7508f4ae54e1d2000decca2e93bb1e18a718

See more details on using hashes here.

Provenance

Supported by

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