Skip to content

Commit 7c80e50

Browse files
committed
Merge branch 'release/v0.3.5'
2 parents d9ea2b3 + abfad69 commit 7c80e50

File tree

8 files changed

+75
-20
lines changed

8 files changed

+75
-20
lines changed

CHANGELOG.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
Django Tagging Changelog
33
========================
44

5+
Version 0.3.5, 13th May 2015:
6+
-----------------------------
7+
8+
* Added support for Django 1.8
9+
* Using migrations to fix syncdb
10+
* Rename get_query_set to get_queryset
11+
* Import GenericForeignKey from the new location
12+
513
Version 0.3.4, 7th November 2014:
614
---------------------------------
715

docs/overview.txt

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Installing an official release
1919
------------------------------
2020

2121
Official releases are made available from
22-
http://code.google.com/p/django-tagging/
22+
https://pypi.python.org/pypi/django-tagging/
2323

2424
Source distribution
2525
~~~~~~~~~~~~~~~~~~~
@@ -45,11 +45,10 @@ Installing the development version
4545

4646
Alternatively, if you'd like to update Django Tagging occasionally to pick
4747
up the latest bug fixes and enhancements before they make it into an
48-
official release, perform a `Subversion`_ checkout instead. The following
49-
command will check the application's development branch out to an
50-
``tagging-trunk`` directory::
48+
official release, clone the git repository instead. The following
49+
command will clone the development branch to ``django-tagging`` directory::
5150

52-
svn checkout http://django-tagging.googlecode.com/svn/trunk/ tagging-trunk
51+
git clone [email protected]:Fantomas42/django-tagging.git
5352

5453
Add the resulting folder to your `PYTHONPATH`_ or symlink (`junction`_,
5554
if you're on Windows) the ``tagging`` directory inside it into a
@@ -61,25 +60,22 @@ opening a Python interpreter and entering the following commands::
6160

6261
>>> import tagging
6362
>>> tagging.VERSION
64-
(0, 3, 'pre')
63+
(0, 3, 4, 'final', 0)
6564

6665
When you want to update your copy of the Django Tagging source code, run
67-
the command ``svn update`` from within the ``tagging-trunk`` directory.
66+
the command ``git pull`` from within the ``django-tagging`` directory.
6867

6968
.. caution::
7069

7170
The development version may contain bugs which are not present in the
7271
release version and introduce backwards-incompatible changes.
7372

74-
If you're tracking trunk, keep an eye on the `CHANGELOG`_ and the
75-
`backwards-incompatible changes wiki page`_ before you update your
76-
copy of the source code.
73+
If you're tracking git, keep an eye on the `CHANGELOG`_
74+
before you update your copy of the source code.
7775

78-
.. _`Subversion`: http://subversion.tigris.org
7976
.. _`PYTHONPATH`: http://www.python.org/doc/2.5.2/tut/node8.html#SECTION008120000000000000000
8077
.. _`junction`: http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx
81-
.. _`CHANGELOG`: http://django-tagging.googlecode.com/svn/trunk/CHANGELOG.txt
82-
.. _`backwards-incompatible changes wiki page`: http://code.google.com/p/django-tagging/wiki/BackwardsIncompatibleChanges
78+
.. _`CHANGELOG`: https://github.com/Fantomas42/django-tagging/blob/develop/CHANGELOG.txt
8379

8480
Using Django Tagging in your applications
8581
-----------------------------------------
@@ -206,7 +202,7 @@ A manager for retrieving tags used by a particular model.
206202

207203
Defines the following methods:
208204

209-
* ``get_query_set()`` -- as this method is redefined, any ``QuerySets``
205+
* ``get_queryset()`` -- as this method is redefined, any ``QuerySets``
210206
created by this model will be initially restricted to contain the
211207
distinct tags used by all the model's instances.
212208

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def fullsplit(path, result=None):
5454
description = 'Generic tagging application for Django',
5555
author = 'Jonathan Buchanan',
5656
author_email = '[email protected]',
57-
url = 'https://code.google.com/p/django-tagging/',
57+
url = 'https://github.com/Fantomas42/django-tagging',
5858
packages = packages,
5959
data_files = data_files,
6060
classifiers = [

tagging/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = (0, 3, 4, "final", 0)
1+
VERSION = (0, 3, 5, "final", 0)
22

33

44
def get_version():

tagging/managers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Custom managers for Django models registered with the tagging
33
application.
44
"""
5+
6+
import django
57
from django.contrib.contenttypes.models import ContentType
68
from django.db import models
79

@@ -12,11 +14,15 @@ class ModelTagManager(models.Manager):
1214
"""
1315
A manager for retrieving tags for a particular model.
1416
"""
15-
def get_query_set(self):
17+
def get_queryset(self):
1618
ctype = ContentType.objects.get_for_model(self.model)
1719
return Tag.objects.filter(
1820
items__content_type__pk=ctype.pk).distinct()
1921

22+
# TODO: drop this
23+
if django.VERSION < (1, 6):
24+
get_query_set = get_queryset
25+
2026
def cloud(self, *args, **kwargs):
2127
return Tag.objects.cloud_for_model(self.model, *args, **kwargs)
2228

tagging/migrations/0001_initial.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
from __future__ import unicode_literals
2+
3+
from django.db import models, migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('contenttypes', '0002_remove_content_type_name'),
10+
]
11+
12+
operations = [
13+
migrations.CreateModel(
14+
name='Tag',
15+
fields=[
16+
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
17+
('name', models.CharField(unique=True, max_length=50, verbose_name='name', db_index=True)),
18+
],
19+
options={
20+
'ordering': ('name',),
21+
'verbose_name': 'tag',
22+
'verbose_name_plural': 'tags',
23+
},
24+
),
25+
migrations.CreateModel(
26+
name='TaggedItem',
27+
fields=[
28+
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
29+
('object_id', models.PositiveIntegerField(verbose_name='object id', db_index=True)),
30+
('content_type', models.ForeignKey(verbose_name='content type', to='contenttypes.ContentType')),
31+
('tag', models.ForeignKey(related_name='items', verbose_name='tag', to='tagging.Tag')),
32+
],
33+
options={
34+
'verbose_name': 'tagged item',
35+
'verbose_name_plural': 'tagged items',
36+
},
37+
),
38+
migrations.AlterUniqueTogether(
39+
name='taggeditem',
40+
unique_together=set([('tag', 'content_type', 'object_id')]),
41+
),
42+
]

tagging/migrations/__init__.py

Whitespace-only changes.

tagging/models.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
from django.db import connection
66
from django.utils.encoding import smart_text
77
from django.utils.encoding import python_2_unicode_compatible
8-
from django.contrib.contenttypes import generic
9-
from django.contrib.contenttypes.models import ContentType
108
from django.utils.translation import ugettext_lazy as _
9+
from django.contrib.contenttypes.models import ContentType
10+
try:
11+
from django.contrib.contenttypes.fields import GenericForeignKey
12+
except ImportError:
13+
from django.contrib.contenttypes.generic import GenericForeignKey
1114

1215
from . import settings
1316
from .utils import LOGARITHMIC
@@ -484,7 +487,7 @@ class TaggedItem(models.Model):
484487
tag = models.ForeignKey(Tag, verbose_name=_('tag'), related_name='items')
485488
content_type = models.ForeignKey(ContentType, verbose_name=_('content type'))
486489
object_id = models.PositiveIntegerField(_('object id'), db_index=True)
487-
object = generic.GenericForeignKey('content_type', 'object_id')
490+
object = GenericForeignKey('content_type', 'object_id')
488491

489492
objects = TaggedItemManager()
490493

0 commit comments

Comments
 (0)