Skip to content

Commit

Permalink
Merge branch 'feature/review-supported-versions' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed May 14, 2015
2 parents c6348ad + 7a8dc23 commit 99854e1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 47 deletions.
15 changes: 0 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
language: python
python:
- 2.6
- 2.7
- 3.2
- 3.3
- 3.4
env:
- DJANGO=1.4
- DJANGO=1.5
- DJANGO=1.6
- DJANGO=1.7
- DJANGO=1.8
matrix:
exclude:
- python: 2.6
env: DJANGO=1.8
- python: 2.6
env: DJANGO=1.7
- python: 3.2
env: DJANGO=1.4
- python: 3.3
env: DJANGO=1.4
- python: 3.4
env: DJANGO=1.4
fast_finish: true
install:
- pip install -U setuptools
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ directory somewhere on your Python path, or symlink to it from
somewhere on your Python path; this is useful if you're working from a
Subversion checkout.

Note that this application requires Python 2.6 or later, and Django
1.4 or later. You can obtain Python from http://www.python.org/ and
Note that this application requires Python 2.7 or later, and Django
1.7 or later. You can obtain Python from http://www.python.org/ and
Django from http://www.djangoproject.com/.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
Expand Down
3 changes: 3 additions & 0 deletions tagging/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Admin components for tagging.
"""
from django.contrib import admin

from .models import Tag, TaggedItem
Expand Down
8 changes: 1 addition & 7 deletions tagging/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
Custom managers for Django models registered with the tagging
application.
"""

import django
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.contrib.contenttypes.models import ContentType

from .models import Tag, TaggedItem

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

# TODO: drop this
if django.VERSION < (1, 6):
get_query_set = get_queryset

def cloud(self, *args, **kwargs):
return Tag.objects.cloud_for_model(self.model, *args, **kwargs)

Expand Down
23 changes: 4 additions & 19 deletions tagging/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
try:
from django.contrib.contenttypes.fields import GenericForeignKey
except ImportError: # Django 1.8
from django.contrib.contenttypes.generic import GenericForeignKey
from django.contrib.contenttypes.fields import GenericForeignKey

from . import settings
from .utils import LOGARITHMIC
Expand Down Expand Up @@ -174,21 +171,9 @@ def usage_for_queryset(self, queryset, counts=False, min_count=None):
greater than or equal to ``min_count`` will be returned.
Passing a value for ``min_count`` implies ``counts=True``.
"""

if getattr(queryset.query, 'get_compiler', None):
compiler = queryset.query.get_compiler(using='default')
if getattr(compiler, 'compile', None):
# Django 1.7+
where, params = compiler.compile(queryset.query.where)
else:
# Django 1.2+
where, params = queryset.query.where.as_sql(
compiler.quote_name_unless_alias, compiler.connection)
extra_joins = ' '.join(compiler.get_from_clause()[0][1:])
else:
# Django pre-1.2
extra_joins = ' '.join(queryset.query.get_from_clause()[0][1:])
where, params = queryset.query.where.as_sql()
compiler = queryset.query.get_compiler(using='default')
where, params = compiler.compile(queryset.query.where)
extra_joins = ' '.join(compiler.get_from_clause()[0][1:])

if where:
extra_criteria = 'AND %s' % where
Expand Down
4 changes: 2 additions & 2 deletions tagging/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
# The maximum length of a tag's name.
MAX_TAG_LENGTH = getattr(settings, 'MAX_TAG_LENGTH', 50)

# Whether to force all tags to lowercase before they are saved to the
# database.
# Whether to force all tags to lowercase
# before they are saved to the database.
FORCE_LOWERCASE_TAGS = getattr(settings, 'FORCE_LOWERCASE_TAGS', False)
2 changes: 1 addition & 1 deletion tagging/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""
import math

from django.db.models.query import QuerySet
from django.utils import six
from django.db.models.query import QuerySet
from django.utils.encoding import force_text
from django.utils.translation import ugettext as _

Expand Down

0 comments on commit 99854e1

Please sign in to comment.