Skip to content

Commit

Permalink
Drop support for Django 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Apr 23, 2015
1 parent c59a664 commit d33696b
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 35 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -5,14 +5,16 @@ python:
- "3.2"
- "3.3"
env:
- DJANGO_PACKAGE="Django>=1.5,<1.6"
- DJANGO_PACKAGE="Django>=1.6,<1.7"
- DJANGO_PACKAGE="Django>=1.7,<1.8"
- DJANGO_PACKAGE="Django>=1.8,<1.9"

matrix:
exclude:
- python: "2.6"
env: DJANGO_PACKAGE="Django>=1.7,<1.8"
- python: "2.6"
env: DJANGO_PACKAGE="Django>=1.8,<1.9"

install:
- pip install $DJANGO_PACKAGE --use-mirrors
Expand Down
4 changes: 2 additions & 2 deletions django_comments/managers.py
Expand Up @@ -8,15 +8,15 @@ def in_moderation(self):
"""
QuerySet for all comments currently in the moderation queue.
"""
return self.get_query_set().filter(is_public=False, is_removed=False)
return self.get_queryset().filter(is_public=False, is_removed=False)

def for_model(self, model):
"""
QuerySet for all comments for a particular model (either an instance or
a class).
"""
ct = ContentType.objects.get_for_model(model)
qs = self.get_query_set().filter(content_type=ct)
qs = self.get_queryset().filter(content_type=ct)
if isinstance(model, models.Model):
qs = qs.filter(object_pk=force_text(model._get_pk_val()))
return qs
6 changes: 3 additions & 3 deletions django_comments/templatetags/comments.py
Expand Up @@ -66,11 +66,11 @@ def __init__(self, ctype=None, object_pk_expr=None, object_expr=None, as_varname
self.comment = comment

def render(self, context):
qs = self.get_query_set(context)
qs = self.get_queryset(context)
context[self.as_varname] = self.get_context_value_from_queryset(context, qs)
return ''

def get_query_set(self, context):
def get_queryset(self, context):
ctype, object_pk = self.get_target_ctype_pk(context)
if not object_pk:
return self.comment_model.objects.none()
Expand Down Expand Up @@ -207,7 +207,7 @@ def render(self, context):
"comments/%s/list.html" % ctype.app_label,
"comments/list.html"
]
qs = self.get_query_set(context)
qs = self.get_queryset(context)
context.push()
liststr = render_to_string(template_search_list, {
"comment_list" : self.get_context_value_from_queryset(context, qs)
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '1.5'
version = '1.6'
# The full version, including alpha/beta/rc tags.
release = '1.5'
release = '1.6'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/example.txt
Expand Up @@ -151,7 +151,7 @@ enable it in your project's ``urls.py``:

Now you should have the latest comment feeds being served off ``/feeds/latest/``.

__ https://docs.djangoproject.com/en/1.5/ref/contrib/syndication/
__ https://docs.djangoproject.com/en/stable/ref/contrib/syndication/

Moderation
==========
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.txt
Expand Up @@ -328,5 +328,5 @@ are not using that, you will need to use the ``csrf_protect`` decorator on any
views that include the comment form, in order for those views to be able to
output the CSRF token and cookie.

.. _cross site request forgery protection: https://docs.djangoproject.com/en/1.5/ref/contrib/csrf/
.. _cross site request forgery protection: https://docs.djangoproject.com/en/stable/ref/csrf/
.. _honeypot: http://en.wikipedia.org/wiki/Honeypot_(computing)
2 changes: 1 addition & 1 deletion docs/signals.txt
Expand Up @@ -9,7 +9,7 @@ The comment app sends a series of signals_ to allow for
comment moderation and similar activities. See `the introduction to signals`_ for information about how to register for and receive these
signals.

.. _signals: https://docs.djangoproject.com/en/1.5/topics/signals/
.. _signals: https://docs.djangoproject.com/en/stable/topics/signals/
.. _the introduction to signals: signals_

comment_will_be_posted
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -10,7 +10,7 @@

setup(
name='django-contrib-comments',
version='1.5.1',
version='1.6.0',
url="http://github.com/django/django-contrib-comments",
description='The code formerly known as django.contrib.comments.',
long_description=long_description,
Expand All @@ -36,5 +36,5 @@
packages=find_packages(exclude=['tests']),
include_package_data=True,
test_suite='tests.runtests.main',
install_requires=['Django>=1.5']
install_requires=['Django>=1.6']
)
3 changes: 2 additions & 1 deletion tests/testapp/tests/templatetag_tests.py
@@ -1,7 +1,8 @@
from __future__ import absolute_import

from django.contrib.contenttypes.models import ContentType
from django.template import Template, Context, Library, libraries
from django.template import Template, Context, Library
from django.template.base import libraries

from django_comments.forms import CommentForm
from django_comments.models import Comment
Expand Down
36 changes: 15 additions & 21 deletions tox.ini
@@ -1,29 +1,11 @@
[tox]
envlist = py26-django15, py27-django15, py32-django15, py33-django15,
py26-django16, py27-django16, py32-django16, py33-django16,
py27-django17, py32-django17, py33-django17
envlist = py26-django16, py27-django16, py32-django16, py33-django16,
py27-django17, py32-django17, py33-django17,
py27-django18, py32-django18, py33-django18

[testenv]
commands = {envpython} setup.py test

[testenv:py26-django15]
basepython = python2.6
deps =
Django>=1.5,<1.6
unittest2

[testenv:py27-django15]
basepython = python2.7
deps = Django>=1.5,<1.6

[testenv:py32-django15]
basepython = python3.2
deps = Django>=1.5,<1.6

[testenv:py33-django15]
basepython = python3.3
deps = Django>=1.5,<1.6

[testenv:py26-django16]
basepython = python2.6
deps =
Expand Down Expand Up @@ -53,3 +35,15 @@ deps = Django>=1.7,<1.8
[testenv:py33-django17]
basepython = python3.3
deps = Django>=1.7,<1.8

[testenv:py27-django18]
basepython = python2.7
deps = Django>=1.8,<1.9

[testenv:py32-django18]
basepython = python3.2
deps = Django>=1.8,<1.9

[testenv:py33-django18]
basepython = python3.3
deps = Django>=1.8,<1.9

0 comments on commit d33696b

Please sign in to comment.