django-taggit (0.17.4-1) unstable; urgency=medium
* New upstream release. # imported from the archivemaster
commit
0c6b364e5e
|
@ -0,0 +1,15 @@
|
|||
django-taggit was originally created by Alex Gaynor.
|
||||
|
||||
The following is a list of much appreciated contributors:
|
||||
|
||||
Nathan Borror <nathan@playgroundblues.com>
|
||||
fakeempire <adam@fakeempire.com>
|
||||
Ben Firshman <ben@firshman.co.uk>
|
||||
Alex Gaynor <alex.gaynor@gmail.com>
|
||||
Rob Hudson <rob@cogit8.org>
|
||||
Carl Meyer <carl@oddbird.net>
|
||||
Frank Wiles
|
||||
Jonathan Buchanan
|
||||
idle sign <idlesign@yandex.ru>
|
||||
Charles Leifer
|
||||
Florian Apolloner <apollo13@apolloner.eu>
|
|
@ -0,0 +1,163 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
0.17.4 (2015-11-25)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Allows custom Through Model with GenericForeignKey
|
||||
* https://github.com/alex/django-taggit/pull/359
|
||||
|
||||
0.17.3 (2015-10-26)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Silence Django 1.9 warning about on_delete
|
||||
* https://github.com/alex/django-taggit/pull/338
|
||||
|
||||
0.17.2 (2015-10-25)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Django 1.9 beta compatibility
|
||||
* https://github.com/alex/django-taggit/pull/352
|
||||
|
||||
0.17.1 (2015-09-10)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Fix unknown column `object_id` issue with Django 1.6+
|
||||
* https://github.com/alex/django-taggit/pull/305
|
||||
|
||||
0.17.0 (2015-08-14)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Database index added on TaggedItem fields content_type & object_id
|
||||
* https://github.com/alex/django-taggit/pull/319
|
||||
|
||||
0.16.4 (2015-08-13)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Access default manager via class instead of instance
|
||||
* https://github.com/alex/django-taggit/pull/335
|
||||
|
||||
0.16.3 (2015-08-08)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Prevent IntegrityError with custom TagBase classes
|
||||
* https://github.com/alex/django-taggit/pull/334
|
||||
|
||||
0.16.2 (2015-07-13)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Fix an admin bug related to the `Manager` property `through_fields`
|
||||
* https://github.com/alex/django-taggit/pull/328
|
||||
|
||||
0.16.1 (2015-07-09)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Fix bug that assumed all primary keys are named 'id'
|
||||
* https://github.com/alex/django-taggit/pull/322
|
||||
|
||||
0.16.0 (2015-07-04)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Add option to allow case-insensitive tags
|
||||
* https://github.com/alex/django-taggit/pull/325
|
||||
|
||||
0.15.0 (2015-06-23)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Fix wrong slugs for non-latin chars
|
||||
* Only works if optional GPL dependency (unidecode) is installed
|
||||
* https://github.com/alex/django-taggit/pull/315
|
||||
* https://github.com/alex/django-taggit/pull/273
|
||||
|
||||
0.14.0 (2015-04-26)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Prevent extra JOIN when prefetching
|
||||
* https://github.com/alex/django-taggit/pull/275
|
||||
* Prevent _meta warnings with Django 1.8
|
||||
* https://github.com/alex/django-taggit/pull/299
|
||||
|
||||
0.13.0 (2015-04-02)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Django 1.8 support
|
||||
* https://github.com/alex/django-taggit/pull/297
|
||||
|
||||
0.12.3 (2015-03-03)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Specify that the internal type of the TaggitManager is a ManyToManyField
|
||||
|
||||
0.12.2 (2014-21-09)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Fixed 1.7 migrations.
|
||||
|
||||
0.12.1 (2014-10-08)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Final (hopefully) fixes for the upcoming Django 1.7 release.
|
||||
* Added Japanese translation.
|
||||
|
||||
0.12.0 (2014-20-04)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* **Backwards incompatible:** Support for Django 1.7 migrations. South users
|
||||
have to set ``SOUTH_MIGRATION_MODULES`` to use ``taggit.south_migrations``
|
||||
for taggit.
|
||||
* **Backwards incompatible:** Django's new transaction handling is used on
|
||||
Django 1.6 and newer.
|
||||
* **Backwards incompatible:** ``Tag.save`` got changed to opportunistically
|
||||
try to save the tag and if that fails fall back to selecting existing
|
||||
similar tags and retry -- if that fails too an ``IntegrityError`` is
|
||||
raised by the database, your app will have to handle that.
|
||||
* Added Italian and Esperanto translations.
|
||||
|
||||
0.11.2 (2013-13-12)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Forbid multiple TaggableManagers via generic foreign keys.
|
||||
|
||||
0.11.1 (2013-25-11)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Fixed support for Django 1.4 and 1.5.
|
||||
|
||||
0.11.0 (2013-25-11)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
* Added support for prefetch_related on tags fields.
|
||||
* Fixed support for Django 1.7.
|
||||
* Made the tagging relations unserializeable again.
|
||||
* Allow more than one TaggableManager on models (assuming concrete FKs are
|
||||
used for the relations).
|
||||
|
||||
0.10.0 (2013-17-08)
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Support for Django 1.6 and 1.7.
|
||||
* Python3 support
|
||||
* **Backwards incompatible:** Dropped support for Django < 1.4.5.
|
||||
* Tag names are unique now, use the provided South migrations to upgrade.
|
||||
|
||||
0.9.2 (2011-01-17)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* **Backwards incompatible:** Forms containing a :class:`TaggableManager` by
|
||||
default now require tags, to change this provide ``blank=True`` to the
|
||||
:class:`TaggableManager`.
|
||||
* Now works with Django 1.3 (as of beta-1).
|
||||
|
||||
0.9.0 (2010-09-22)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Added a Hebrew locale.
|
||||
* Added an index on the ``object_id`` field of ``TaggedItem``.
|
||||
* When displaying tags always join them with commas, never spaces.
|
||||
* The docs are now available `online <http://django-taggit.readthedocs.org/>`_.
|
||||
* Custom ``Tag`` models are now allowed.
|
||||
* **Backwards incompatible:** Filtering on tags is no longer
|
||||
``filter(tags__in=["foo"])``, it is written
|
||||
``filter(tags__name__in=["foo"])``.
|
||||
* Added a German locale.
|
||||
* Added a Dutch locale.
|
||||
* Removed ``taggit.contrib.suggest``, it now lives in an external application,
|
||||
see :doc:`external_apps` for more information.
|
||||
|
||||
0.8.0 (2010-06-22)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Fixed querying for objects using ``exclude(tags__in=tags)``.
|
||||
* Marked strings as translatable.
|
||||
|
||||
* Added a Russian translation.
|
||||
* Created a `mailing list <http://groups.google.com/group/django-taggit>`_.
|
||||
* Smarter tagstring parsing for form field; ported from Jonathan
|
||||
Buchanan's `django-tagging
|
||||
<http://django-tagging.googlecode.com>`_. Now supports tags
|
||||
containing commas. See :ref:`tags-in-forms` for details.
|
||||
* Switched to using savepoints around the slug generation for tags. This
|
||||
ensures that it works fine on databases (such as Postgres) which dirty a
|
||||
transaction with an ``IntegrityError``.
|
||||
* Added Python 2.4 compatibility.
|
||||
* Added Django 1.1 compatibility.
|
|
@ -0,0 +1,27 @@
|
|||
Copyright (c) Alex Gaynor and individual contributors.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of django-taggit nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,9 @@
|
|||
include AUTHORS
|
||||
include CHANGELOG.txt
|
||||
include LICENSE
|
||||
include README.rst
|
||||
include tox.ini
|
||||
include runtests.py
|
||||
recursive-include docs *
|
||||
recursive-include taggit/locale *
|
||||
recursive-include tests *
|
|
@ -0,0 +1,62 @@
|
|||
Metadata-Version: 1.1
|
||||
Name: django-taggit
|
||||
Version: 0.17.4
|
||||
Summary: django-taggit is a reusable Django application for simple tagging.
|
||||
Home-page: http://github.com/alex/django-taggit/tree/master
|
||||
Author: Alex Gaynor
|
||||
Author-email: alex.gaynor@gmail.com
|
||||
License: BSD
|
||||
Description: django-taggit
|
||||
=============
|
||||
|
||||
``django-taggit`` a simpler approach to tagging with Django. Add ``"taggit"`` to your
|
||||
``INSTALLED_APPS`` then just add a TaggableManager to your model and go:
|
||||
|
||||
.. code:: python
|
||||
|
||||
from django.db import models
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
class Food(models.Model):
|
||||
# ... fields here
|
||||
|
||||
tags = TaggableManager()
|
||||
|
||||
|
||||
Then you can use the API like so:
|
||||
|
||||
.. code:: python
|
||||
|
||||
>>> apple = Food.objects.create(name="apple")
|
||||
>>> apple.tags.add("red", "green", "delicious")
|
||||
>>> apple.tags.all()
|
||||
[<Tag: red>, <Tag: green>, <Tag: delicious>]
|
||||
>>> apple.tags.remove("green")
|
||||
>>> apple.tags.all()
|
||||
[<Tag: red>, <Tag: delicious>]
|
||||
>>> Food.objects.filter(tags__name__in=["red"])
|
||||
[<Food: apple>, <Food: cherry>]
|
||||
|
||||
Tags will show up for you automatically in forms and the admin.
|
||||
|
||||
``django-taggit`` requires Django 1.4.5 or greater.
|
||||
|
||||
For more info check out the `documentation <https://django-taggit.readthedocs.org/en/latest/>`_. And for questions about usage or
|
||||
development you can contact the
|
||||
`mailinglist <http://groups.google.com/group/django-taggit>`_.
|
||||
|
||||
Platform: UNKNOWN
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Environment :: Web Environment
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: BSD License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 2.6
|
||||
Classifier: Programming Language :: Python :: 2.7
|
||||
Classifier: Programming Language :: Python :: 3.2
|
||||
Classifier: Programming Language :: Python :: 3.3
|
||||
Classifier: Programming Language :: Python :: 3.4
|
||||
Classifier: Framework :: Django
|
|
@ -0,0 +1,39 @@
|
|||
django-taggit
|
||||
=============
|
||||
|
||||
``django-taggit`` a simpler approach to tagging with Django. Add ``"taggit"`` to your
|
||||
``INSTALLED_APPS`` then just add a TaggableManager to your model and go:
|
||||
|
||||
.. code:: python
|
||||
|
||||
from django.db import models
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
class Food(models.Model):
|
||||
# ... fields here
|
||||
|
||||
tags = TaggableManager()
|
||||
|
||||
|
||||
Then you can use the API like so:
|
||||
|
||||
.. code:: python
|
||||
|
||||
>>> apple = Food.objects.create(name="apple")
|
||||
>>> apple.tags.add("red", "green", "delicious")
|
||||
>>> apple.tags.all()
|
||||
[<Tag: red>, <Tag: green>, <Tag: delicious>]
|
||||
>>> apple.tags.remove("green")
|
||||
>>> apple.tags.all()
|
||||
[<Tag: red>, <Tag: delicious>]
|
||||
>>> Food.objects.filter(tags__name__in=["red"])
|
||||
[<Food: apple>, <Food: cherry>]
|
||||
|
||||
Tags will show up for you automatically in forms and the admin.
|
||||
|
||||
``django-taggit`` requires Django 1.4.5 or greater.
|
||||
|
||||
For more info check out the `documentation <https://django-taggit.readthedocs.org/en/latest/>`_. And for questions about usage or
|
||||
development you can contact the
|
||||
`mailinglist <http://groups.google.com/group/django-taggit>`_.
|
|
@ -0,0 +1,97 @@
|
|||
django-taggit (0.17.4-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Fri, 27 Nov 2015 08:37:05 +0100
|
||||
|
||||
django-taggit (0.17.3-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
- Django 1.9 compatibility.
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Thu, 29 Oct 2015 14:44:36 +0100
|
||||
|
||||
django-taggit (0.17.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Thu, 17 Sep 2015 09:47:25 +0200
|
||||
|
||||
django-taggit (0.17.0-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* Update debian/watch.
|
||||
* Add python 3 package.
|
||||
* Run tests during build.
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Mon, 24 Aug 2015 13:44:42 +0200
|
||||
|
||||
django-taggit (0.12.2-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
- Fixed 1.7 migrations.
|
||||
* Bump standards to 3.9.6.
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Thu, 25 Sep 2014 09:20:46 +0200
|
||||
|
||||
django-taggit (0.12.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
- Complete support for Django 1.7 (Closes: #755614).
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Mon, 11 Aug 2014 09:55:45 +0200
|
||||
|
||||
django-taggit (0.12-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
- Backwards incompatible: Support for Django 1.7 migrations. South users
|
||||
have to set SOUTH_MIGRATION_MODULES to use taggit.south_migrations
|
||||
for taggit.
|
||||
- Backwards incompatible: Django's new transaction handling is used on
|
||||
Django 1.6 and newer.
|
||||
- Backwards incompatible: Tag.save got changed to opportunistically
|
||||
try to save the tag and if that fails fall back to selecting existing
|
||||
similar tags and retry -- if that fails too an IntegrityError is
|
||||
raised by the database, your app will have to handle that.
|
||||
- Added Italian and Esperanto translations.
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Tue, 29 Apr 2014 10:05:29 +0200
|
||||
|
||||
django-taggit (0.11.2-2) unstable; urgency=medium
|
||||
|
||||
* Bump standards to 3.9.5.
|
||||
* Really do not ship tests in module without namespace (Closes: #738210).
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Mon, 10 Feb 2014 09:36:44 +0100
|
||||
|
||||
django-taggit (0.11.2-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release.
|
||||
* Do not ship tests in module without namespace (Closes: #733729).
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Fri, 03 Jan 2014 10:20:12 +0100
|
||||
|
||||
django-taggit (0.11.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
* Bump standards to 3.9.5.
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Mon, 09 Dec 2013 14:00:12 +0100
|
||||
|
||||
django-taggit (0.10a1-3) unstable; urgency=low
|
||||
|
||||
* Fixed Vcs-* fields in debian/control (Closes: #721524).
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Mon, 09 Sep 2013 09:36:36 +0200
|
||||
|
||||
django-taggit (0.10a1-2) unstable; urgency=low
|
||||
|
||||
* Fix typo in package name.
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Thu, 15 Aug 2013 16:48:21 +0200
|
||||
|
||||
django-taggit (0.10a1-1) unstable; urgency=low
|
||||
|
||||
* Initial release. (Closes: #719809)
|
||||
|
||||
-- Michal Čihař <nijel@debian.org> Thu, 15 Aug 2013 16:31:05 +0200
|
|
@ -0,0 +1 @@
|
|||
9
|
|
@ -0,0 +1,41 @@
|
|||
Source: django-taggit
|
||||
Section: python
|
||||
Priority: optional
|
||||
Maintainer: Michal Čihař <nijel@debian.org>
|
||||
Uploaders: Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org>
|
||||
Build-Depends: debhelper (>= 9)
|
||||
Build-Depends-Indep: python (>= 2.6.6-3), python-setuptools, python3-setuptools, python3-all, dh-python, python-django, python3-django
|
||||
Standards-Version: 3.9.6
|
||||
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/django-taggit.git
|
||||
Vcs-Git: git://anonscm.debian.org/collab-maint/django-taggit.git
|
||||
Homepage: https://github.com/alex/django-taggit
|
||||
X-Python-Version: >= 2.6
|
||||
X-Python3-Version: >= 3.2
|
||||
|
||||
Package: python-django-taggit
|
||||
Architecture: all
|
||||
Depends: ${python:Depends}, ${misc:Depends}, python-django
|
||||
Breaks: ${python:Breaks}
|
||||
Description: simple tagging for Django (Python 2)
|
||||
This is a generic tagging application for Django, which allows
|
||||
association of a number of tags with any Model instance and makes
|
||||
retrieval of tags simple.
|
||||
.
|
||||
django-taggit a simpler approach to tagging with Django. Add "taggit" to your
|
||||
INSTALLED_APPS then just add a TaggableManager to your model.
|
||||
.
|
||||
This package installs the library for Python 2.
|
||||
|
||||
Package: python3-django-taggit
|
||||
Architecture: all
|
||||
Depends: ${python3:Depends}, ${misc:Depends}, python3-django
|
||||
Breaks: ${python3:Breaks}
|
||||
Description: simple tagging for Django (Python 3)
|
||||
This is a generic tagging application for Django, which allows
|
||||
association of a number of tags with any Model instance and makes
|
||||
retrieval of tags simple.
|
||||
.
|
||||
django-taggit a simpler approach to tagging with Django. Add "taggit" to your
|
||||
INSTALLED_APPS then just add a TaggableManager to your model.
|
||||
.
|
||||
This package installs the library for Python 3.
|
|
@ -0,0 +1,54 @@
|
|||
This package was debianized by Michal Čihař <nijel@debian.org> on
|
||||
Thu, 15 Aug 2013 16:18:02 +0200.
|
||||
|
||||
It was downloaded from <https://pypi.python.org/pypi/django-taggit>.
|
||||
|
||||
Upstream Authors:
|
||||
|
||||
Nathan Borror <nathan@playgroundblues.com>
|
||||
fakeempire <adam@fakeempire.com>
|
||||
Ben Firshman <ben@firshman.co.uk>
|
||||
Alex Gaynor <alex.gaynor@gmail.com>
|
||||
Rob Hudson <rob@cogit8.org>
|
||||
Carl Meyer <carl@oddbird.net>
|
||||
Frank Wiles
|
||||
Jonathan Buchanan
|
||||
idle sign <idlesign@yandex.ru>
|
||||
Charles Leifer
|
||||
Florian Apolloner <apollo13@apolloner.eu>
|
||||
|
||||
Copyright:
|
||||
|
||||
Copyright (c) Alex Gaynor and individual contributors.
|
||||
|
||||
License:
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of django-taggit nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL-2'.
|
||||
|
||||
The Debian packaging is Copyright (C) 2013, Michal Čihař
|
||||
<nijel@debian.org> and is licensed under the GPL, see above.
|
|
@ -0,0 +1,5 @@
|
|||
# Configuration file for git-buildpackage and friends
|
||||
|
||||
[DEFAULT]
|
||||
sign-tags = True
|
||||
pristine-tar = True
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
export PYBUILD_NAME=django-taggit
|
||||
%:
|
||||
dh $@ --fail-missing --with python2,python3 --buildsystem=pybuild
|
||||
|
||||
override_dh_auto_test:
|
||||
python2 runtests.py
|
||||
python3 runtests.py
|
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
|
@ -0,0 +1,2 @@
|
|||
version=3
|
||||
http://pypi.debian.net/django-taggit/django-taggit-(.*)\.tar\.gz
|
|
@ -0,0 +1,62 @@
|
|||
Metadata-Version: 1.1
|
||||
Name: django-taggit
|
||||
Version: 0.17.4
|
||||
Summary: django-taggit is a reusable Django application for simple tagging.
|
||||
Home-page: http://github.com/alex/django-taggit/tree/master
|
||||
Author: Alex Gaynor
|
||||
Author-email: alex.gaynor@gmail.com
|
||||
License: BSD
|
||||
Description: django-taggit
|
||||
=============
|
||||
|
||||
``django-taggit`` a simpler approach to tagging with Django. Add ``"taggit"`` to your
|
||||
``INSTALLED_APPS`` then just add a TaggableManager to your model and go:
|
||||
|
||||
.. code:: python
|
||||
|
||||
from django.db import models
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
class Food(models.Model):
|
||||
# ... fields here
|
||||
|
||||
tags = TaggableManager()
|
||||
|
||||
|
||||
Then you can use the API like so:
|
||||
|
||||
.. code:: python
|
||||
|
||||
>>> apple = Food.objects.create(name="apple")
|
||||
>>> apple.tags.add("red", "green", "delicious")
|
||||
>>> apple.tags.all()
|
||||
[<Tag: red>, <Tag: green>, <Tag: delicious>]
|
||||
>>> apple.tags.remove("green")
|
||||
>>> apple.tags.all()
|
||||
[<Tag: red>, <Tag: delicious>]
|
||||
>>> Food.objects.filter(tags__name__in=["red"])
|
||||
[<Food: apple>, <Food: cherry>]
|
||||
|
||||
Tags will show up for you automatically in forms and the admin.
|
||||
|
||||
``django-taggit`` requires Django 1.4.5 or greater.
|
||||
|
||||
For more info check out the `documentation <https://django-taggit.readthedocs.org/en/latest/>`_. And for questions about usage or
|
||||
development you can contact the
|
||||
`mailinglist <http://groups.google.com/group/django-taggit>`_.
|
||||
|
||||
Platform: UNKNOWN
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Environment :: Web Environment
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: BSD License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 2.6
|
||||
Classifier: Programming Language :: Python :: 2.7
|
||||
Classifier: Programming Language :: Python :: 3.2
|
||||
Classifier: Programming Language :: Python :: 3.3
|
||||
Classifier: Programming Language :: Python :: 3.4
|
||||
Classifier: Framework :: Django
|
|
@ -0,0 +1,64 @@
|
|||
AUTHORS
|
||||
CHANGELOG.txt
|
||||
LICENSE
|
||||
MANIFEST.in
|
||||
README.rst
|
||||
runtests.py
|
||||
setup.cfg
|
||||
setup.py
|
||||
tox.ini
|
||||
django_taggit.egg-info/PKG-INFO
|
||||
django_taggit.egg-info/SOURCES.txt
|
||||
django_taggit.egg-info/dependency_links.txt
|
||||
django_taggit.egg-info/not-zip-safe
|
||||
django_taggit.egg-info/top_level.txt
|
||||
docs/Makefile
|
||||
docs/admin.txt
|
||||
docs/api.txt
|
||||
docs/changelog.txt
|
||||
docs/conf.py
|
||||
docs/custom_tagging.txt
|
||||
docs/external_apps.txt
|
||||
docs/forms.txt
|
||||
docs/getting_started.txt
|
||||
docs/index.txt
|
||||
taggit/__init__.py
|
||||
taggit/admin.py
|
||||
taggit/forms.py
|
||||
taggit/managers.py
|
||||
taggit/models.py
|
||||
taggit/utils.py
|
||||
taggit/views.py
|
||||
taggit/locale/cs/LC_MESSAGES/django.mo
|
||||
taggit/locale/cs/LC_MESSAGES/django.po
|
||||
taggit/locale/de/LC_MESSAGES/django.mo
|
||||
taggit/locale/de/LC_MESSAGES/django.po
|
||||
taggit/locale/en/LC_MESSAGES/django.po
|
||||
taggit/locale/eo/LC_MESSAGES/django.mo
|
||||
taggit/locale/eo/LC_MESSAGES/django.po
|
||||
taggit/locale/he/LC_MESSAGES/django.mo
|
||||
taggit/locale/he/LC_MESSAGES/django.po
|
||||
taggit/locale/it/LC_MESSAGES/django.mo
|
||||
taggit/locale/it/LC_MESSAGES/django.po
|
||||
taggit/locale/ja/LC_MESSAGES/django.mo
|
||||
taggit/locale/ja/LC_MESSAGES/django.po
|
||||
taggit/locale/nb/LC_MESSAGES/django.mo
|
||||
taggit/locale/nb/LC_MESSAGES/django.po
|
||||
taggit/locale/nl/LC_MESSAGES/django.mo
|
||||
taggit/locale/nl/LC_MESSAGES/django.po
|
||||
taggit/locale/pt_BR/LC_MESSAGES/django.mo
|
||||
taggit/locale/pt_BR/LC_MESSAGES/django.po
|
||||
taggit/locale/ru/LC_MESSAGES/django.mo
|
||||
taggit/locale/ru/LC_MESSAGES/django.po
|
||||
taggit/migrations/0001_initial.py
|
||||
taggit/migrations/0002_auto_20150616_2121.py
|
||||
taggit/migrations/__init__.py
|
||||
taggit/south_migrations/0001_initial.py
|
||||
taggit/south_migrations/0002_unique_tagnames.py
|
||||
taggit/south_migrations/__init__.py
|
||||
tests/__init__.py
|
||||
tests/forms.py
|
||||
tests/models.py
|
||||
tests/tests.py
|
||||
tests/migrations/0001_initial.py
|
||||
tests/migrations/__init__.py
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1 @@
|
|||
taggit
|
|
@ -0,0 +1,89 @@
|
|||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/django-taggit.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/django-taggit.qhc"
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
|
||||
"run these through (pdf)latex."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
|
@ -0,0 +1,14 @@
|
|||
Using tags in the admin
|
||||
=======================
|
||||
|
||||
By default if you have a :class:`TaggableManager` on your model it will show up
|
||||
in the admin, just as it will in any other form. One important thing to note
|
||||
is that you *cannot* include a :class:`TaggableManager` in
|
||||
:attr:`ModelAdmin.list_display`, if you do you'll see an exception that looks
|
||||
like::
|
||||
|
||||
AttributeError: 'TaggableManager' object has no attribute 'flatchoices'
|
||||
|
||||
This is for the same reason that you cannot include a :class:`ManyToManyField`,
|
||||
it would result in an unreasonable number of queries being executed. If you really would like to add it, you can read the
|
||||
`Django documentation <http://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display>`_.
|
|
@ -0,0 +1,114 @@
|
|||
The API
|
||||
=======
|
||||
|
||||
After you've got your ``TaggableManager`` added to your model you can start
|
||||
playing around with the API.
|
||||
|
||||
.. class:: TaggableManager([verbose_name="Tags", help_text="A comma-separated list of tags.", through=None, blank=False])
|
||||
|
||||
:param verbose_name: The verbose_name for this field.
|
||||
:param help_text: The help_text to be used in forms (including the admin).
|
||||
:param through: The through model, see :doc:`custom_tagging` for more
|
||||
information.
|
||||
:param blank: Controls whether this field is required.
|
||||
|
||||
.. method:: add(*tags)
|
||||
|
||||
This adds tags to an object. The tags can be either ``Tag`` instances, or
|
||||
strings::
|
||||
|
||||
>>> apple.tags.all()
|
||||
[]
|
||||
>>> apple.tags.add("red", "green", "fruit")
|
||||
|
||||
.. method:: remove(*tags)
|
||||
|
||||
Removes a tag from an object. No exception is raised if the object
|
||||
doesn't have that tag.
|
||||
|
||||
.. method:: clear()
|
||||
|
||||
Removes all tags from an object.
|
||||
|
||||
.. method:: set(*tags)
|
||||
|
||||
Removes all the current tags and then adds the specified tags to the
|
||||
object.
|
||||
|
||||
.. method: most_common()
|
||||
|
||||
Returns a ``QuerySet`` of all tags, annotated with the number of times
|
||||
they appear, available as the ``num_times`` attribute on each tag. The
|
||||
``QuerySet``is ordered by ``num_times``, descending. The ``QuerySet``
|
||||
is lazily evaluated, and can be sliced efficiently.
|
||||
|
||||
.. method:: similar_objects()
|
||||
|
||||
Returns a list (not a lazy ``QuerySet``) of other objects tagged
|
||||
similarly to this one, ordered with most similar first. Each object in
|
||||
the list is decorated with a ``similar_tags`` attribute, the number of
|
||||
tags it shares with this object.
|
||||
|
||||
If the model is using generic tagging (the default), this method
|
||||
searches tagged objects from all classes. If you are querying on a
|
||||
model with its own tagging through table, only other instances of the
|
||||
same model will be returned.
|
||||
|
||||
.. method:: names()
|
||||
|
||||
Convenience method, returning a ``ValuesListQuerySet`` (basically
|
||||
just an iterable) containing the name of each tag as a string::
|
||||
|
||||
>>> apple.tags.names()
|
||||
[u'green and juicy', u'red']
|
||||
|
||||
.. method:: slugs()
|
||||
|
||||
Convenience method, returning a ``ValuesListQuerySet`` (basically
|
||||
just an iterable) containing the slug of each tag as a string::
|
||||
|
||||
>>> apple.tags.slugs()
|
||||
[u'green-and-juicy', u'red']
|
||||
|
||||
.. hint::
|
||||
|
||||
You can subclass ``_TaggableManager`` (note the underscore) to add
|
||||
methods or functionality. ``TaggableManager`` takes an optional
|
||||
manager keyword argument for your custom class, like this::
|
||||
|
||||
class Food(models.Model):
|
||||
# ... fields here
|
||||
tags = TaggableManager(manager=_CustomTaggableManager)
|
||||
|
||||
Filtering
|
||||
~~~~~~~~~
|
||||
|
||||
To find all of a model with a specific tags you can filter, using the normal
|
||||
Django ORM API. For example if you had a ``Food`` model, whose
|
||||
``TaggableManager`` was named ``tags``, you could find all the delicious fruit
|
||||
like so::
|
||||
|
||||
>>> Food.objects.filter(tags__name__in=["delicious"])
|
||||
[<Food: apple>, <Food: pear>, <Food: plum>]
|
||||
|
||||
|
||||
If you're filtering on multiple tags, it's very common to get duplicate
|
||||
results, because of the way relational databases work. Often you'll want to
|
||||
make use of the ``distinct()`` method on ``QuerySets``::
|
||||
|
||||
>>> Food.objects.filter(tags__name__in=["delicious", "red"])
|
||||
[<Food: apple>, <Food: apple>]
|
||||
>>> Food.objects.filter(tags__name__in=["delicious", "red"]).distinct()
|
||||
[<Food: apple>]
|
||||
|
||||
You can also filter by the slug on tags. If you're using a custom ``Tag``
|
||||
model you can use this API to filter on any fields it has.
|
||||
|
||||
Aggregation
|
||||
~~~~~~~~~~~
|
||||
|
||||
Unfortunately, due to a
|
||||
`bug in Django <http://code.djangoproject.com/ticket/10870>`_, it is not
|
||||
currently (Django < 1.6) possible to use aggregation in conjunction with ``taggit``. This is
|
||||
a `documented interaction <http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#generic-relations-and-aggregation>`_
|
||||
of generic relations (which ``taggit`` uses internally) and aggregates.
|
|
@ -0,0 +1 @@
|
|||
.. include:: ../CHANGELOG.txt
|
|
@ -0,0 +1,198 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# django-taggit documentation build configuration file, created by
|
||||
# sphinx-quickstart on Mon May 3 22:22:47 2010.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys, os
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.append(os.path.abspath('.'))
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['sphinx.ext.intersphinx']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.txt'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'django-taggit'
|
||||
copyright = u'2010-2014, Alex Gaynor and others.'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.12'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.12'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of documents that shouldn't be included in the build.
|
||||
#unused_docs = []
|
||||
|
||||
# List of directories, relative to source directory, that shouldn't be searched
|
||||
# for source files.
|
||||
exclude_trees = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
|
||||
# -- Options for HTML output ---------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. Major themes that come with
|
||||
# Sphinx are currently 'default' and 'sphinxdoc'.
|
||||
html_theme = 'default'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
#html_static_path = ['_static']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_use_modindex = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = ''
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'django-taggitdoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
|
||||
# The paper size ('letter' or 'a4').
|
||||
#latex_paper_size = 'letter'
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#latex_font_size = '10pt'
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'django-taggit.tex', u'django-taggit Documentation',
|
||||
u'Alex Gaynor', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#latex_preamble = ''
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_use_modindex = True
|
||||
|
||||
|
||||
# Example configuration for intersphinx: refer to the Python standard library.
|
||||
intersphinx_mapping = {'http://docs.python.org/': None}
|
|
@ -0,0 +1,167 @@
|
|||
Using a Custom Tag or Through Model
|
||||
===================================
|
||||
|
||||
By default ``django-taggit`` uses a "through model" with a
|
||||
``GenericForeignKey`` on it, that has another ``ForeignKey`` to an included
|
||||
``Tag`` model. However, there are some cases where this isn't desirable, for
|
||||
example if you want the speed and referential guarantees of a real
|
||||
``ForeignKey``, if you have a model with a non-integer primary key, or if you
|
||||
want to store additional data about a tag, such as whether it is official. In
|
||||
these cases ``django-taggit`` makes it easy to substitute your own through
|
||||
model, or ``Tag`` model.
|
||||
|
||||
To change the behavior there are a number of classes you can subclass to obtain
|
||||
different behavior:
|
||||
|
||||
=============================== =======================================================================
|
||||
Class name Behavior
|
||||
=============================== =======================================================================
|
||||
``TaggedItemBase`` Allows custom ``ForeignKeys`` to models.
|
||||
``GenericTaggedItemBase`` Allows custom ``Tag`` models. Tagged models use an integer primary key.
|
||||
``GenericUUIDTaggedItemBase`` Allows custom ``Tag`` models. Tagged models use a UUID primary key.
|
||||
``CommonGenericTaggedItemBase`` Allows custom ``Tag`` models and ``GenericForeignKeys`` to models.
|
||||
``ItemBase`` Allows custom ``Tag`` models and ``ForeignKeys`` to models.
|
||||
=============================== =======================================================================
|
||||
|
||||
Custom ForeignKeys
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Your intermediary model must be a subclass of
|
||||
``taggit.models.TaggedItemBase`` with a foreign key to your content
|
||||
model named ``content_object``. Pass this intermediary model as the
|
||||
``through`` argument to ``TaggableManager``::
|
||||
|
||||
from django.db import models
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
from taggit.models import TaggedItemBase
|
||||
|
||||
|
||||
class TaggedFood(TaggedItemBase):
|
||||
content_object = models.ForeignKey('Food')
|
||||
|
||||
class Food(models.Model):
|
||||
# ... fields here
|
||||
|
||||
tags = TaggableManager(through=TaggedFood)
|
||||
|
||||
|
||||
Once this is done, the API works the same as for GFK-tagged models.
|
||||
|
||||
Custom GenericForeignKeys
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The default ``GenericForeignKey`` used by ``django-taggit`` assume your
|
||||
tagged object use an integer primary key. For non-integer primary key,
|
||||
your intermediary model must be a subclass of ``taggit.models.CommonGenericTaggedItemBase``
|
||||
with a field named ``"object_id"`` of the type of your primary key.
|
||||
|
||||
For example, if your primary key is a string::
|
||||
|
||||
from django.db import models
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
from taggit.models import CommonGenericTaggedItemBase, TaggedItemBase
|
||||
|
||||
class GenericStringTaggedItem(CommonGenericTaggedItemBase, TaggedItemBase):
|
||||
object_id = models.CharField(max_length=50, verbose_name=_('Object id'), db_index=True)
|
||||
|
||||
class Food(models.Model):
|
||||
food_id = models.CharField(primary_key=True)
|
||||
# ... fields here
|
||||
|
||||
tags = TaggableManager(through=GenericStringTaggedItem)
|
||||
|
||||
GenericUUIDTaggedItemBase
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. note::
|
||||
|
||||
``GenericUUIDTaggedItemBase`` relies on Django UUIDField introduced with
|
||||
Django 1.8. Therefore ``GenericUUIDTaggedItemBase`` is only defined
|
||||
if you are using Django 1.8+.
|
||||
|
||||
A common use case of a non-integer primary key, is UUID primary key.
|
||||
``django-taggit`` provides a base class ``GenericUUIDTaggedItemBase`` ready
|
||||
to use with models using an UUID primary key::
|
||||
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
from taggit.models import GenericUUIDTaggedItemBase, TaggedItemBase
|
||||
|
||||
class UUIDTaggedItem(GenericUUIDTaggedItemBase, TaggedItemBase):
|
||||
# If you only inherit GenericUUIDTaggedItemBase, you need to define
|
||||
# a tag field. e.g.
|
||||
# tag = models.ForeignKey(Tag, related_name="uuid_tagged_items", on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Tag")
|
||||
verbose_name_plural = _("Tags")
|
||||
|
||||
class Food(models.Model):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
# ... fields here
|
||||
|
||||
tags = TaggableManager(through=UUIDTaggedItem)
|
||||
|
||||
Custom tag
|
||||
~~~~~~~~~~
|
||||
|
||||
When providing a custom ``Tag`` model it should be a ``ForeignKey`` to your tag
|
||||
model named ``"tag"``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
from taggit.models import TagBase, GenericTaggedItemBase
|
||||
|
||||
|
||||
class MyCustomTag(TagBase):
|
||||
# ... fields here
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Tag")
|
||||
verbose_name_plural = _("Tags")
|
||||
|
||||
# ... methods (if any) here
|
||||
|
||||
|
||||
class TaggedWhatever(GenericTaggedItemBase):
|
||||
# TaggedWhatever can also extend TaggedItemBase or a combination of
|
||||
# both TaggedItemBase and GenericTaggedItemBase. GenericTaggedItemBase
|
||||
# allows using the same tag for different kinds of objects, in this
|
||||
# example Food and Drink.
|
||||
|
||||
# Here is where you provide your custom Tag class.
|
||||
tag = models.ForeignKey(MyCustomTag,
|
||||
related_name="%(app_label)s_%(class)s_items")
|
||||
|
||||
|
||||
class Food(models.Model):
|
||||
# ... fields here
|
||||
|
||||
tags = TaggableManager(through=TaggedWhatever)
|
||||
|
||||
|
||||
class Drink(models.Model):
|
||||
# ... fields here
|
||||
|
||||
tags = TaggableManager(through=TaggedWhatever)
|
||||
|
||||
|
||||
.. class:: TagBase
|
||||
|
||||
.. method:: slugify(tag, i=None)
|
||||
|
||||
By default ``taggit`` uses :func:`django.template.defaultfilters.slugify`
|
||||
to calculate a slug for a given tag. However, if you want to implement
|
||||
your own logic you can override this method, which receives the ``tag``
|
||||
(a string), and ``i``, which is either ``None`` or an integer, which
|
||||
signifies how many times the slug for this tag has been attempted to be
|
||||
calculated, it is ``None`` on the first time, and the counting begins
|
||||
at ``1`` thereafter.
|
|
@ -0,0 +1,34 @@
|
|||
External Applications
|
||||
=====================
|
||||
|
||||
In addition to the features included in ``django-taggit`` directly, there are a
|
||||
number of external applications which provide additional features that may be
|
||||
of interest.
|
||||
|
||||
.. note::
|
||||
|
||||
Despite their mention here, the following applications are in no way
|
||||
official, nor have they in any way been reviewed or tested.
|
||||
|
||||
|
||||
If you have an application that you'd like to see listed here, simply fork
|
||||
``taggit`` on `github`__, add it to this list, and send a pull request.
|
||||
|
||||
* ``django-taggit-suggest``: Provides support for defining keyword and regular
|
||||
expression rules for suggesting new tags for content. This used to be
|
||||
available at ``taggit.contrib.suggest``. Available on `github`__.
|
||||
* ``django-taggit-templatetags``: Provides several templatetags, including one
|
||||
for tag clouds, to expose various ``taggit`` APIs directly to templates.
|
||||
Available on `github`__.
|
||||
* ``django-taggit-helpers``: Makes it easier to work with admin pages of models
|
||||
associated with ``taggit`` tags by adding helper classes: ``TaggitCounter``,
|
||||
``TaggitListFilter``, ``TaggitStackedInline``, ``TaggitTabularInline``.
|
||||
Available on `github`__.
|
||||
* ``django-taggit-labels``: Provides a clickable label widget for the
|
||||
Django admin for user friendly selection from managed tag sets.
|
||||
|
||||
__ http://github.com/alex/django-taggit
|
||||
__ http://github.com/frankwiles/django-taggit-suggest
|
||||
__ http://github.com/feuervogel/django-taggit-templatetags
|
||||
__ http://github.com/mfcovington/django-taggit-helpers
|
||||
__ https://github.com/bennylope/django-taggit-labels
|
|
@ -0,0 +1,51 @@
|
|||
.. _tags-in-forms:
|
||||
|
||||
Tags in forms
|
||||
=============
|
||||
|
||||
The ``TaggableManager`` will show up automatically as a field in a
|
||||
``ModelForm`` or in the admin. Tags input via the form field are parsed
|
||||
as follows:
|
||||
|
||||
* If the input doesn't contain any commas or double quotes, it is simply
|
||||
treated as a space-delimited list of tag names.
|
||||
|
||||
* If the input does contain either of these characters:
|
||||
|
||||
* Groups of characters which appear between double quotes take
|
||||
precedence as multi-word tags (so double quoted tag names may
|
||||
contain commas). An unclosed double quote will be ignored.
|
||||
|
||||
* Otherwise, if there are any unquoted commas in the input, it will
|
||||
be treated as comma-delimited. If not, it will be treated as
|
||||
space-delimited.
|
||||
|
||||
Examples:
|
||||
|
||||
====================== ================================= ================================================
|
||||
Tag input string Resulting tags Notes
|
||||
====================== ================================= ================================================
|
||||
apple ball cat ``["apple", "ball", "cat"]`` No commas, so space delimited
|
||||
apple, ball cat ``["apple", "ball cat"]`` Comma present, so comma delimited
|
||||
"apple, ball" cat dog ``["apple, ball", "cat", "dog"]`` All commas are quoted, so space delimited
|
||||
"apple, ball", cat dog ``["apple, ball", "cat dog"]`` Contains an unquoted comma, so comma delimited
|
||||
apple "ball cat" dog ``["apple", "ball cat", "dog"]`` No commas, so space delimited
|
||||
"apple" "ball dog ``["apple", "ball", "dog"]`` Unclosed double quote is ignored
|
||||
====================== ================================= ================================================
|
||||
|
||||
|
||||
``commit=False``
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
If, when saving a form, you use the ``commit=False`` option you'll need to call
|
||||
``save_m2m()`` on the form after you save the object, just as you would for a
|
||||
form with normal many to many fields on it::
|
||||
|
||||
if request.method == "POST":
|
||||
form = MyFormClass(request.POST)
|
||||
if form.is_valid():
|
||||
obj = form.save(commit=False)
|
||||
obj.user = request.user
|
||||
obj.save()
|
||||
# Without this next line the tags won't be saved.
|
||||
form.save_m2m()
|
|
@ -0,0 +1,39 @@
|
|||
Getting Started
|
||||
===============
|
||||
|
||||
To get started using ``django-taggit`` simply install it with
|
||||
``pip``::
|
||||
|
||||
$ pip install django-taggit
|
||||
|
||||
|
||||
Add ``"taggit"`` to your project's ``INSTALLED_APPS`` setting.
|
||||
|
||||
Run `./manage.py syncdb` or `./manage.py migrate` if using migrations.
|
||||
|
||||
.. note::
|
||||
|
||||
If you are using South you'll have to add the following setting, since
|
||||
taggit uses Django migrations by default::
|
||||
|
||||
SOUTH_MIGRATION_MODULES = {
|
||||
'taggit': 'taggit.south_migrations',
|
||||
}
|
||||
|
||||
And then to any model you want tagging on do the following::
|
||||
|
||||
from django.db import models
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
class Food(models.Model):
|
||||
# ... fields here
|
||||
|
||||
tags = TaggableManager()
|
||||
|
||||
.. note::
|
||||
|
||||
If you want ``django-taggit`` to be **CASE INSENSITIVE** when looking up existing tags, you'll have to set to ``True`` the TAGGIT_CASE_INSENSITIVE setting (by default ``False``)::
|
||||
|
||||
TAGGIT_CASE_INSENSITIVE = True
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
Welcome to django-taggit's documentation!
|
||||
=========================================
|
||||
|
||||
``django-taggit`` is a reusable Django application designed to making adding
|
||||
tagging to your project easy and fun.
|
||||
|
||||
``django-taggit`` works with Django 1.4.5+ and Python 2.7-3.X.
|
||||
|
||||
.. warning::
|
||||
|
||||
Since version 0.10.0 taggit uses South for database migrations.
|
||||
This means that users who are upgrading to 0.10.0 and up will have to fake
|
||||
the initial migration, like this::
|
||||
|
||||
python manage.py migrate taggit --fake 0001
|
||||
python manage.py migrate
|
||||
|
||||
Since version 0.12.0 taggit uses Django migrations by default. South users
|
||||
have to adjust their settings::
|
||||
|
||||
SOUTH_MIGRATION_MODULES = {
|
||||
'taggit': 'taggit.south_migrations',
|
||||
}
|
||||
|
||||
For more information, see `south documentation`__
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
getting_started
|
||||
forms
|
||||
admin
|
||||
api
|
||||
custom_tagging
|
||||
external_apps
|
||||
changelog
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
__ http://south.readthedocs.org/en/latest/
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python
|
||||
import os
|
||||
import sys
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
|
||||
if not settings.configured:
|
||||
settings.configure(
|
||||
DATABASES={
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
}
|
||||
},
|
||||
INSTALLED_APPS=[
|
||||
'django.contrib.contenttypes',
|
||||
'taggit',
|
||||
'tests',
|
||||
],
|
||||
MIDDLEWARE_CLASSES=[],
|
||||
)
|
||||
|
||||
|
||||
def runtests():
|
||||
argv = sys.argv[:1] + ['test'] + sys.argv[1:]
|
||||
execute_from_command_line(argv)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
runtests()
|
|
@ -0,0 +1,18 @@
|
|||
[metadata]
|
||||
license-file = LICENSE
|
||||
|
||||
[wheel]
|
||||
universal = 1
|
||||
|
||||
[flake8]
|
||||
ignore = E501,E302
|
||||
exclude = south_migrations,migrations
|
||||
|
||||
[isort]
|
||||
forced_separate = tests,taggit
|
||||
|
||||
[egg_info]
|
||||
tag_build =
|
||||
tag_date = 0
|
||||
tag_svn_revision = 0
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
from setuptools import setup, find_packages
|
||||
|
||||
import taggit
|
||||
|
||||
|
||||
with open('README.rst') as f:
|
||||
readme = f.read()
|
||||
|
||||
setup(
|
||||
name='django-taggit',
|
||||
version='.'.join(str(i) for i in taggit.VERSION),
|
||||
description='django-taggit is a reusable Django application for simple tagging.',
|
||||
long_description=readme,
|
||||
author='Alex Gaynor',
|
||||
author_email='alex.gaynor@gmail.com',
|
||||
url='http://github.com/alex/django-taggit/tree/master',
|
||||
packages=find_packages(exclude=('tests*',)),
|
||||
package_data = {
|
||||
'taggit': [
|
||||
'locale/*/LC_MESSAGES/*',
|
||||
],
|
||||
},
|
||||
license='BSD',
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Environment :: Web Environment',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: BSD License',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3.2',
|
||||
'Programming Language :: Python :: 3.3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Framework :: Django',
|
||||
],
|
||||
include_package_data=True,
|
||||
zip_safe=False,
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
VERSION = (0, 17, 4)
|
|
@ -0,0 +1,21 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
from taggit.models import Tag, TaggedItem
|
||||
|
||||
|
||||
class TaggedItemInline(admin.StackedInline):
|
||||
model = TaggedItem
|
||||
|
||||
class TagAdmin(admin.ModelAdmin):
|
||||
inlines = [
|
||||
TaggedItemInline
|
||||
]
|
||||
list_display = ["name", "slug"]
|
||||
ordering = ["name", "slug"]
|
||||
search_fields = ["name"]
|
||||
prepopulated_fields = {"slug": ["name"]}
|
||||
|
||||
|
||||
admin.site.register(Tag, TagAdmin)
|
|
@ -0,0 +1,27 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django import forms
|
||||
from django.utils import six
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from taggit.utils import edit_string_for_tags, parse_tags
|
||||
|
||||
|
||||
class TagWidget(forms.TextInput):
|
||||
def render(self, name, value, attrs=None):
|
||||
if value is not None and not isinstance(value, six.string_types):
|
||||
value = edit_string_for_tags([
|
||||
o.tag for o in value.select_related("tag")])
|
||||
return super(TagWidget, self).render(name, value, attrs)
|
||||
|
||||
|
||||
class TagField(forms.CharField):
|
||||
widget = TagWidget
|
||||
|
||||
def clean(self, value):
|
||||
value = super(TagField, self).clean(value)
|
||||
try:
|
||||
return parse_tags(value)
|
||||
except ValueError:
|
||||
raise forms.ValidationError(
|
||||
_("Please provide a comma-separated list of tags."))
|
Binary file not shown.
|
@ -0,0 +1,64 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-08-01 16:52+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
||||
|
||||
#: forms.py:24
|
||||
msgid "Please provide a comma-separated list of tags."
|
||||
msgstr "Vložte čárkami oddělený seznam tagů"
|
||||
|
||||
#: managers.py:59 models.py:59
|
||||
msgid "Tags"
|
||||
msgstr "Tagy"
|
||||
|
||||
#: managers.py:60
|
||||
msgid "A comma-separated list of tags."
|
||||
msgstr "Čárkami oddělený seznam tagů"
|
||||
|
||||
#: models.py:15
|
||||
msgid "Name"
|
||||
msgstr "Jméno"
|
||||
|
||||
#: models.py:16
|
||||
msgid "Slug"
|
||||
msgstr "Slug"
|
||||
|
||||
#: models.py:58
|
||||
msgid "Tag"
|
||||
msgstr "Tag"
|
||||
|
||||
#: models.py:65
|
||||
#, python-format
|
||||
msgid "%(object)s tagged with %(tag)s"
|
||||
msgstr "%(object)s označen tagem %(tag)s"
|
||||
|
||||
#: models.py:112
|
||||
msgid "Object id"
|
||||
msgstr "ID objektu"
|
||||
|
||||
#: models.py:115
|
||||
msgid "Content type"
|
||||
msgstr "Typ obsahu"
|
||||