GithubHelp home page GithubHelp logo

weijia / django-tagging-ng Goto Github PK

View Code? Open in Web Editor NEW

This project forked from svetlyak40wt/django-tagging-ng

0.0 2.0 0.0 227 KB

Django tagging with multilingual, synonyms and hierarchy!

Home Page: http://code.google.com/p/django-tagging/

License: Other

Shell 0.05% Python 99.95%

django-tagging-ng's Introduction

=================
Django Tagging NG
=================

This is a enhanced tagging application for Django projects

- For installation instructions, see the file "INSTALL.txt" in this directory

- For detailed instructions on how to configure and know all possibilities of this application, see the file "OVERVIEW.txt"


Rquirements
-----------
Note that this application requires Python 2.3 or later, and Django 0.96 or later. You can obtain Python from http://www.python.org/ and Django from http://www.djangoproject.com/.


Quickstart
----------

1.- Register a model:

   from django.db import models
   import tagging
   from shop.apps.products.models import Widget

   class Widget(models.Model):
       name = models.CharField(max_length=50)

   tagging.register(Widget)

2.- Use it

   w = Widget.objects.get(...)

   from tagging.models import Tag, TaggedItem
   house_tag = Tag.objects.get(name='house')
   thing_tag = Tag.objects.get(name='thing')

    - Set tags for instance:
    w.tags = 'tag1 tag2'

    - Get tag for instance:
    w.tags
     [<Tag: tag1>, <Tag: tag2>]

    - Retrive instances with tag1 AND tag2
   TaggedItem.objects.get_by_model(Widget, [house_tag, thing_tag])
   [<Widget: pk=1>]

    - Retrieve filtered instances with 'tag1'
   TaggedItem.objects.get_by_model(Widget.objects.filter(price__lt=50), 'house')


    - Get all tags for a model:
   Widget.tags.all()
   [<Tag: tag1>, <Tag: tag2>>]

    - Get tags for a model with usage counts:
    Widget.tags.count()

    - Get related tags (retrieve tags used by model instances which are also tagged with tag1 and tag2)
    Widget.tags.related('tag1', min_count=1)
    [<Tag: tag2>]
    Widget.tags.related(['tag1', 'tag2'], min_count=1)
    []


Authors
-------

This application is based on the original code, written by:
    Jonathan Buchanan <[email protected]>

Enhanced by:
    Alexander Artemenko <[email protected]>
    Antti Kaihola <[email protected]>
    GW [http://gw.tnode.com/] <[email protected]>
    Concha Labra https://github.com/clabra

Sources
-------

Django-tagging-ng: http://github.com/svetlyak40wt/django-tagging-ng/
Django-tagging:    http://code.google.com/p/django-tagging/

django-tagging-ng's People

Contributors

svetlyak40wt avatar weijia avatar clabra avatar gw0 avatar akaihola avatar flebel avatar pombredanne avatar

Watchers

 avatar James Cloos 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.