GithubHelp home page GithubHelp logo

cclauss / django-category Goto Github PK

View Code? Open in Web Editor NEW

This project forked from praekelt/django-category

0.0 2.0 0.0 35 KB

Django categorize content app.

License: BSD 3-Clause "New" or "Revised" License

Python 95.68% HTML 4.32%

django-category's Introduction

Django Category

Simple category app providing category and tag models.

Travis

Installation

  1. Install or add django-category to your Python path.
  2. Add category to your INSTALLED_APPS setting.
  3. If you are on Django < 1.7 then add south to your INSTALLED_APPS setting.
  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.

django-category's People

Contributors

hedleyroos avatar ruands avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.