Git Product home page Git Product logo

django-taxonomies's Introduction

This app provides a generic taxonomy model where you can create any types
of taxonomy you want.  This is handled by TaxonomyGroup, TaxonomyItem,
TaxonomyMember, and TaxonomyMap objects.

Any model can be mapped to any taxonomy you want with no changes to
the database tables required for existing models.

Models:
TaxonomyGroup:
        This is what you are naming your class of taxonomy.  It could be tags,
        categories, types of animals, anything you want to call it and have it
        represent.

TaxonomyItem:
        These represent a specific classifcation within a TaxonomyGroup.
        If your TaxonomyGroup is "types of animals" then this would probably
        contains items such as "dog", "cat", "elephant", "dragon", etc.

TaxonomyMap:
        This maps your objects to a TaxonomyItem.  There are shortcuts built
        into the classes so that these objects rarely need touched and do
        their work behind the scenes.

TaxonomyMember:
        This is an abstract base class.  It does not create a database table
        and does not currently define any fields.  It just provides a couple of
        helpful methods for the models to interract with the taxonomy app.

Admin:
A TaxonomyMapInline is provided which can be used as an inline for any models.
This inline allows taxonomies to be set on the models directly when editing them
in their own admin.  This way there is no need to go into the TaxonomyMap admin
which is a bit of a hassle to use due to needing to know.  It does not currently
let you filter out by specific TaxonomyGroup, but it should in the future.

Template Tags:
A template tag library named taxonomy_tags is included.  This has one tag,
taxonomy_members, which takes the taxonomy group, taxonomy item, 
and optionally "as var_name".  If the var name is not specified, the list will
automatically be assigned to the variable "members".

{% load taxonomy_tags %}
{% taxonomy_members mygroup myitem as related_items %}
{% for item in related_items %}
{% item %}<br />
{% endfor %}

Thanks/Additional Credits:
I got the idea for this app from https://github.com/bkjones/django-taxonomy,
but no code was copied, I just liked the idea and wanted to see if I could
write my own app.

django-taxonomies's People

Contributors

jmichalicek avatar marcelchastain avatar

Stargazers

 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.