Skip to content

Commit 99854e1

Browse files
committed
Merge branch 'feature/review-supported-versions' into develop
2 parents c6348ad + 7a8dc23 commit 99854e1

File tree

8 files changed

+13
-47
lines changed

8 files changed

+13
-47
lines changed

.travis.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
language: python
22
python:
3-
- 2.6
43
- 2.7
54
- 3.2
65
- 3.3
76
- 3.4
87
env:
9-
- DJANGO=1.4
10-
- DJANGO=1.5
11-
- DJANGO=1.6
128
- DJANGO=1.7
139
- DJANGO=1.8
1410
matrix:
15-
exclude:
16-
- python: 2.6
17-
env: DJANGO=1.8
18-
- python: 2.6
19-
env: DJANGO=1.7
20-
- python: 3.2
21-
env: DJANGO=1.4
22-
- python: 3.3
23-
env: DJANGO=1.4
24-
- python: 3.4
25-
env: DJANGO=1.4
2611
fast_finish: true
2712
install:
2813
- pip install -U setuptools

INSTALL.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ directory somewhere on your Python path, or symlink to it from
99
somewhere on your Python path; this is useful if you're working from a
1010
Subversion checkout.
1111

12-
Note that this application requires Python 2.6 or later, and Django
13-
1.4 or later. You can obtain Python from http://www.python.org/ and
12+
Note that this application requires Python 2.7 or later, and Django
13+
1.7 or later. You can obtain Python from http://www.python.org/ and
1414
Django from http://www.djangoproject.com/.

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
'License :: OSI Approved :: BSD License',
3636
'Programming Language :: Python',
3737
'Programming Language :: Python :: 2',
38-
'Programming Language :: Python :: 2.6',
3938
'Programming Language :: Python :: 2.7',
4039
'Programming Language :: Python :: 3',
4140
'Topic :: Utilities',

tagging/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"""
2+
Admin components for tagging.
3+
"""
14
from django.contrib import admin
25

36
from .models import Tag, TaggedItem

tagging/managers.py

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

108
from .models import Tag, TaggedItem
119

@@ -19,10 +17,6 @@ def get_queryset(self):
1917
return Tag.objects.filter(
2018
items__content_type__pk=ctype.pk).distinct()
2119

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

tagging/models.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
from django.utils.encoding import python_2_unicode_compatible
88
from django.utils.translation import ugettext_lazy as _
99
from django.contrib.contenttypes.models import ContentType
10-
try:
11-
from django.contrib.contenttypes.fields import GenericForeignKey
12-
except ImportError: # Django 1.8
13-
from django.contrib.contenttypes.generic import GenericForeignKey
10+
from django.contrib.contenttypes.fields import GenericForeignKey
1411

1512
from . import settings
1613
from .utils import LOGARITHMIC
@@ -174,21 +171,9 @@ def usage_for_queryset(self, queryset, counts=False, min_count=None):
174171
greater than or equal to ``min_count`` will be returned.
175172
Passing a value for ``min_count`` implies ``counts=True``.
176173
"""
177-
178-
if getattr(queryset.query, 'get_compiler', None):
179-
compiler = queryset.query.get_compiler(using='default')
180-
if getattr(compiler, 'compile', None):
181-
# Django 1.7+
182-
where, params = compiler.compile(queryset.query.where)
183-
else:
184-
# Django 1.2+
185-
where, params = queryset.query.where.as_sql(
186-
compiler.quote_name_unless_alias, compiler.connection)
187-
extra_joins = ' '.join(compiler.get_from_clause()[0][1:])
188-
else:
189-
# Django pre-1.2
190-
extra_joins = ' '.join(queryset.query.get_from_clause()[0][1:])
191-
where, params = queryset.query.where.as_sql()
174+
compiler = queryset.query.get_compiler(using='default')
175+
where, params = compiler.compile(queryset.query.where)
176+
extra_joins = ' '.join(compiler.get_from_clause()[0][1:])
192177

193178
if where:
194179
extra_criteria = 'AND %s' % where

tagging/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
# The maximum length of a tag's name.
99
MAX_TAG_LENGTH = getattr(settings, 'MAX_TAG_LENGTH', 50)
1010

11-
# Whether to force all tags to lowercase before they are saved to the
12-
# database.
11+
# Whether to force all tags to lowercase
12+
# before they are saved to the database.
1313
FORCE_LOWERCASE_TAGS = getattr(settings, 'FORCE_LOWERCASE_TAGS', False)

tagging/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"""
55
import math
66

7-
from django.db.models.query import QuerySet
87
from django.utils import six
8+
from django.db.models.query import QuerySet
99
from django.utils.encoding import force_text
1010
from django.utils.translation import ugettext as _
1111

0 commit comments

Comments
 (0)