Commit d33696bbf1b2047bb3f58aa4d01423040caf279d

Authored by Claude Paroz
1 parent c59a6648

Drop support for Django 1.5

@@ -5,14 +5,16 @@ python: @@ -5,14 +5,16 @@ python:
5 - "3.2" 5 - "3.2"
6 - "3.3" 6 - "3.3"
7 env: 7 env:
8 - - DJANGO_PACKAGE="Django>=1.5,<1.6"  
9 - DJANGO_PACKAGE="Django>=1.6,<1.7" 8 - DJANGO_PACKAGE="Django>=1.6,<1.7"
10 - DJANGO_PACKAGE="Django>=1.7,<1.8" 9 - DJANGO_PACKAGE="Django>=1.7,<1.8"
  10 + - DJANGO_PACKAGE="Django>=1.8,<1.9"
11 11
12 matrix: 12 matrix:
13 exclude: 13 exclude:
14 - python: "2.6" 14 - python: "2.6"
15 env: DJANGO_PACKAGE="Django>=1.7,<1.8" 15 env: DJANGO_PACKAGE="Django>=1.7,<1.8"
  16 + - python: "2.6"
  17 + env: DJANGO_PACKAGE="Django>=1.8,<1.9"
16 18
17 install: 19 install:
18 - pip install $DJANGO_PACKAGE --use-mirrors 20 - pip install $DJANGO_PACKAGE --use-mirrors
@@ -8,7 +8,7 @@ class CommentManager(models.Manager): @@ -8,7 +8,7 @@ class CommentManager(models.Manager):
8 """ 8 """
9 QuerySet for all comments currently in the moderation queue. 9 QuerySet for all comments currently in the moderation queue.
10 """ 10 """
11 - return self.get_query_set().filter(is_public=False, is_removed=False) 11 + return self.get_queryset().filter(is_public=False, is_removed=False)
12 12
13 def for_model(self, model): 13 def for_model(self, model):
14 """ 14 """
@@ -16,7 +16,7 @@ class CommentManager(models.Manager): @@ -16,7 +16,7 @@ class CommentManager(models.Manager):
16 a class). 16 a class).
17 """ 17 """
18 ct = ContentType.objects.get_for_model(model) 18 ct = ContentType.objects.get_for_model(model)
19 - qs = self.get_query_set().filter(content_type=ct) 19 + qs = self.get_queryset().filter(content_type=ct)
20 if isinstance(model, models.Model): 20 if isinstance(model, models.Model):
21 qs = qs.filter(object_pk=force_text(model._get_pk_val())) 21 qs = qs.filter(object_pk=force_text(model._get_pk_val()))
22 return qs 22 return qs
@@ -66,11 +66,11 @@ class BaseCommentNode(template.Node): @@ -66,11 +66,11 @@ class BaseCommentNode(template.Node):
66 self.comment = comment 66 self.comment = comment
67 67
68 def render(self, context): 68 def render(self, context):
69 - qs = self.get_query_set(context) 69 + qs = self.get_queryset(context)
70 context[self.as_varname] = self.get_context_value_from_queryset(context, qs) 70 context[self.as_varname] = self.get_context_value_from_queryset(context, qs)
71 return '' 71 return ''
72 72
73 - def get_query_set(self, context): 73 + def get_queryset(self, context):
74 ctype, object_pk = self.get_target_ctype_pk(context) 74 ctype, object_pk = self.get_target_ctype_pk(context)
75 if not object_pk: 75 if not object_pk:
76 return self.comment_model.objects.none() 76 return self.comment_model.objects.none()
@@ -207,7 +207,7 @@ class RenderCommentListNode(CommentListNode): @@ -207,7 +207,7 @@ class RenderCommentListNode(CommentListNode):
207 "comments/%s/list.html" % ctype.app_label, 207 "comments/%s/list.html" % ctype.app_label,
208 "comments/list.html" 208 "comments/list.html"
209 ] 209 ]
210 - qs = self.get_query_set(context) 210 + qs = self.get_queryset(context)
211 context.push() 211 context.push()
212 liststr = render_to_string(template_search_list, { 212 liststr = render_to_string(template_search_list, {
213 "comment_list" : self.get_context_value_from_queryset(context, qs) 213 "comment_list" : self.get_context_value_from_queryset(context, qs)
@@ -48,9 +48,9 @@ copyright = u'2013, Django Software Foundation and contributors' @@ -48,9 +48,9 @@ copyright = u'2013, Django Software Foundation and contributors'
48 # built documents. 48 # built documents.
49 # 49 #
50 # The short X.Y version. 50 # The short X.Y version.
51 -version = '1.5' 51 +version = '1.6'
52 # The full version, including alpha/beta/rc tags. 52 # The full version, including alpha/beta/rc tags.
53 -release = '1.5' 53 +release = '1.6'
54 54
55 # The language for content autogenerated by Sphinx. Refer to documentation 55 # The language for content autogenerated by Sphinx. Refer to documentation
56 # for a list of supported languages. 56 # for a list of supported languages.
@@ -151,7 +151,7 @@ enable it in your project's ``urls.py``: @@ -151,7 +151,7 @@ enable it in your project's ``urls.py``:
151 151
152 Now you should have the latest comment feeds being served off ``/feeds/latest/``. 152 Now you should have the latest comment feeds being served off ``/feeds/latest/``.
153 153
154 -__ https://docs.djangoproject.com/en/1.5/ref/contrib/syndication/ 154 +__ https://docs.djangoproject.com/en/stable/ref/contrib/syndication/
155 155
156 Moderation 156 Moderation
157 ========== 157 ==========
@@ -328,5 +328,5 @@ are not using that, you will need to use the ``csrf_protect`` decorator on any @@ -328,5 +328,5 @@ are not using that, you will need to use the ``csrf_protect`` decorator on any
328 views that include the comment form, in order for those views to be able to 328 views that include the comment form, in order for those views to be able to
329 output the CSRF token and cookie. 329 output the CSRF token and cookie.
330 330
331 -.. _cross site request forgery protection: https://docs.djangoproject.com/en/1.5/ref/contrib/csrf/ 331 +.. _cross site request forgery protection: https://docs.djangoproject.com/en/stable/ref/csrf/
332 .. _honeypot: http://en.wikipedia.org/wiki/Honeypot_(computing) 332 .. _honeypot: http://en.wikipedia.org/wiki/Honeypot_(computing)
@@ -9,7 +9,7 @@ The comment app sends a series of signals_ to allow for @@ -9,7 +9,7 @@ The comment app sends a series of signals_ to allow for
9 comment moderation and similar activities. See `the introduction to signals`_ for information about how to register for and receive these 9 comment moderation and similar activities. See `the introduction to signals`_ for information about how to register for and receive these
10 signals. 10 signals.
11 11
12 -.. _signals: https://docs.djangoproject.com/en/1.5/topics/signals/ 12 +.. _signals: https://docs.djangoproject.com/en/stable/topics/signals/
13 .. _the introduction to signals: signals_ 13 .. _the introduction to signals: signals_
14 14
15 comment_will_be_posted 15 comment_will_be_posted
@@ -10,7 +10,7 @@ except IOError: @@ -10,7 +10,7 @@ except IOError:
10 10
11 setup( 11 setup(
12 name='django-contrib-comments', 12 name='django-contrib-comments',
13 - version='1.5.1', 13 + version='1.6.0',
14 url="http://github.com/django/django-contrib-comments", 14 url="http://github.com/django/django-contrib-comments",
15 description='The code formerly known as django.contrib.comments.', 15 description='The code formerly known as django.contrib.comments.',
16 long_description=long_description, 16 long_description=long_description,
@@ -36,5 +36,5 @@ setup( @@ -36,5 +36,5 @@ setup(
36 packages=find_packages(exclude=['tests']), 36 packages=find_packages(exclude=['tests']),
37 include_package_data=True, 37 include_package_data=True,
38 test_suite='tests.runtests.main', 38 test_suite='tests.runtests.main',
39 - install_requires=['Django>=1.5'] 39 + install_requires=['Django>=1.6']
40 ) 40 )
1 from __future__ import absolute_import 1 from __future__ import absolute_import
2 2
3 from django.contrib.contenttypes.models import ContentType 3 from django.contrib.contenttypes.models import ContentType
4 -from django.template import Template, Context, Library, libraries 4 +from django.template import Template, Context, Library
  5 +from django.template.base import libraries
5 6
6 from django_comments.forms import CommentForm 7 from django_comments.forms import CommentForm
7 from django_comments.models import Comment 8 from django_comments.models import Comment
1 [tox] 1 [tox]
2 -envlist = py26-django15, py27-django15, py32-django15, py33-django15,  
3 - py26-django16, py27-django16, py32-django16, py33-django16,  
4 - py27-django17, py32-django17, py33-django17 2 +envlist = py26-django16, py27-django16, py32-django16, py33-django16,
  3 + py27-django17, py32-django17, py33-django17,
  4 + py27-django18, py32-django18, py33-django18
5 5
6 [testenv] 6 [testenv]
7 commands = {envpython} setup.py test 7 commands = {envpython} setup.py test
8 8
9 -[testenv:py26-django15]  
10 -basepython = python2.6  
11 -deps =  
12 - Django>=1.5,<1.6  
13 - unittest2  
14 -  
15 -[testenv:py27-django15]  
16 -basepython = python2.7  
17 -deps = Django>=1.5,<1.6  
18 -  
19 -[testenv:py32-django15]  
20 -basepython = python3.2  
21 -deps = Django>=1.5,<1.6  
22 -  
23 -[testenv:py33-django15]  
24 -basepython = python3.3  
25 -deps = Django>=1.5,<1.6  
26 -  
27 [testenv:py26-django16] 9 [testenv:py26-django16]
28 basepython = python2.6 10 basepython = python2.6
29 deps = 11 deps =
@@ -53,3 +35,15 @@ deps = Django>=1.7,<1.8 @@ -53,3 +35,15 @@ deps = Django>=1.7,<1.8
53 [testenv:py33-django17] 35 [testenv:py33-django17]
54 basepython = python3.3 36 basepython = python3.3
55 deps = Django>=1.7,<1.8 37 deps = Django>=1.7,<1.8
  38 +
  39 +[testenv:py27-django18]
  40 +basepython = python2.7
  41 +deps = Django>=1.8,<1.9
  42 +
  43 +[testenv:py32-django18]
  44 +basepython = python3.2
  45 +deps = Django>=1.8,<1.9
  46 +
  47 +[testenv:py33-django18]
  48 +basepython = python3.3
  49 +deps = Django>=1.8,<1.9
Please register or login to post a comment