general: remove django 1.7 support (#15851)

This commit is contained in:
Frédéric Péters 2017-04-12 15:20:06 +02:00
parent 1b29b385a0
commit 9f4d602735
4 changed files with 10 additions and 18 deletions

View File

@ -29,12 +29,7 @@ from django.http import (Http404, HttpResponse, HttpResponseRedirect,
HttpResponsePermanentRedirect)
from django.shortcuts import render, resolve_url
from django.template import RequestContext, loader
from django.utils import timezone
if django.VERSION >= (1, 8):
from django.utils import lorem_ipsum
else:
from django.contrib.webdesign import lorem_ipsum
from django.utils import lorem_ipsum, timezone
from django.utils.translation import ugettext as _
from django.forms.widgets import Media
@ -101,16 +96,13 @@ def ajax_page_cell(request, page_pk, cell_reference):
# Cell can pass data through its own __dict__
cell.modify_global_context(context, request)
if django.VERSION < (1, 8, 0):
# FIXME: we bind to an existing template to have the list of
# context processors applied to the RequestContext; the
# CellBase.render() method should be extended to accept an additional
# request parameter, to match the new Template::render() signature.
template = loader.get_template('combo/page_template.html')
with context.bind_template(template.template):
return HttpResponse(cell.render(context), content_type='text/html')
else:
# FIXME: we bind to an existing template to have the list of
# context processors applied to the RequestContext; the
# CellBase.render() method should be extended to accept an additional
# request parameter, to match the new Template::render() signature.
template = loader.get_template('combo/page_template.html')
with context.bind_template(template.template):
return HttpResponse(cell.render(context), content_type='text/html')
def extend_with_parent_cells(cells):

2
debian/control vendored
View File

@ -9,7 +9,7 @@ X-Python-Version: >= 2.7
Package: python-combo
Architecture: all
Depends: ${misc:Depends}, ${python:Depends},
python-django (>= 1.7),
python-django (>= 1.8), python-django (<< 1.9),
python-djangorestframework (>= 3.3),
python-gadjo,
python-requests,

View File

@ -1,4 +1,4 @@
Django>=1.7, <1.9
Django>=1.8, <1.9
django-ckeditor<4.5.3
gadjo
django-cmsplugin-blurp

View File

@ -103,7 +103,7 @@ setup(
'Programming Language :: Python',
'Programming Language :: Python :: 2',
],
install_requires=['django>=1.7, <1.9',
install_requires=['django>=1.8, <1.9',
'django-ckeditor<4.5.3',
'gadjo',
'django-cmsplugin-blurp',