Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Mar 4, 2015
2 parents ed8af52 + 4be7c2d commit 9be3e9e
Show file tree
Hide file tree
Showing 17 changed files with 159 additions and 207 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ env:
- TOXENV=py34-1.6.x
- TOXENV=py34-1.7.x
install:
- pip install tox
- pip install flake8 tox
before_script:
- flake8 taggit
script:
- tox
notifications:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

0.12.3 (03.03.2015)
~~~~~~~~~~~~~~~~~~~
* Specify that the internal type of the TaggitManager is a ManyToManyField

0.12.2 (21.09.2014)
~~~~~~~~~~~~~~~~~~~
* Fixed 1.7 migrations.
Expand Down
15 changes: 7 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
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,

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

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
Expand All @@ -25,4 +25,3 @@ 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.

8 changes: 6 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ 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::
``INSTALLED_APPS`` then just add a TaggableManager to your model and go:

.. code:: python
from django.db import models
Expand All @@ -14,7 +16,9 @@ django-taggit
tags = TaggableManager()
Then you can use the API like so::
Then you can use the API like so:

.. code:: python
>>> apple = Food.objects.create(name="apple")
>>> apple.tags.add("red", "green", "delicious")
Expand Down
2 changes: 1 addition & 1 deletion docs/admin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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`,
Expand Down
8 changes: 4 additions & 4 deletions docs/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ playing around with the API.
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::

Expand All @@ -69,11 +69,11 @@ playing around with the API.

>>> 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
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):
Expand Down
2 changes: 1 addition & 1 deletion docs/forms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ apple "ball cat" dog ``["apple", "ball cat", "dog"]`` No commas, so space del
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():
Expand Down
1 change: 0 additions & 1 deletion docs/getting_started.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ And then to any model you want tagging on do the following::
# ... fields here

tags = TaggableManager()

1 change: 0 additions & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ def runtests():

if __name__ == '__main__':
runtests()

1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ universal=1
# E302: expected 2 blank lines, found 1 [E302]
# E501: line too long
ignore=E501,E302
exclude = south_migrations,migrations

[isort]
forced_separate=tests,taggit
1 change: 0 additions & 1 deletion taggit/locale/he/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ msgstr ""
#: contrib/suggest/models.py:57
msgid "Enter a valid Regular Expression. To make it case-insensitive include \"(?i)\" in your expression."
msgstr ""

1 change: 0 additions & 1 deletion taggit/locale/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ msgstr "Objecten getagged"
#: contrib/suggest/models.py:57
msgid "Enter a valid Regular Expression. To make it case-insensitive include \"(?i)\" in your expression."
msgstr "Voer een valide reguliere expressie in. Voeg \"(?i)\" aan de expressie toe om deze hoofdletter ongevoelig te maken."

1 change: 0 additions & 1 deletion taggit/locale/ru/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ msgstr "Элементы с меткой"
#: contrib/suggest/models.py:57
msgid "Enter a valid Regular Expression. To make it case-insensitive include \"(?i)\" in your expression."
msgstr "Введите регулярное выражение. Чтобы сделать его чувствительным к регистру укажите \"(?i)\"."

4 changes: 3 additions & 1 deletion taggit/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
pass # PathInfo is not used on Django < 1.6



def _model_name(model):
if VERSION < (1, 7):
return model._meta.module_name
Expand Down Expand Up @@ -298,6 +297,9 @@ def resolve_related_class(field, model, cls):
else:
self.post_through_setup(cls)

def get_internal_type(self):
return 'ManyToManyField'

def __lt__(self, other):
"""
Required contribute_to_class as Django uses bisect
Expand Down
14 changes: 7 additions & 7 deletions taggit/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(unique=True, max_length=100, verbose_name='Name')),
('slug', models.SlugField(unique=True, max_length=100, verbose_name='Slug')),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, help_text='', verbose_name='ID')),
('name', models.CharField(help_text='', unique=True, max_length=100, verbose_name='Name')),
('slug', models.SlugField(help_text='', unique=True, max_length=100, verbose_name='Slug')),
],
options={
'verbose_name': 'Tag',
Expand All @@ -27,10 +27,10 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='TaggedItem',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('object_id', models.IntegerField(verbose_name='Object id', db_index=True)),
('content_type', models.ForeignKey(related_name='taggit_taggeditem_tagged_items', verbose_name='Content type', to='contenttypes.ContentType')),
('tag', models.ForeignKey(related_name='taggit_taggeditem_items', to='taggit.Tag')),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, help_text='', verbose_name='ID')),
('object_id', models.IntegerField(help_text='', verbose_name='Object id', db_index=True)),
('content_type', models.ForeignKey(related_name='taggit_taggeditem_tagged_items', verbose_name='Content type', to='contenttypes.ContentType', help_text='')),
('tag', models.ForeignKey(related_name='taggit_taggeditem_items', to='taggit.Tag', help_text='')),
],
options={
'verbose_name': 'Tagged Item',
Expand Down

0 comments on commit 9be3e9e

Please sign in to comment.