Skip to content

Commit 6ba11f7

Browse files
authored
Merge pull request #14 from novafloss/9-deprecate-django16-django17
graceful deprecation of Django 1.6 and 1.7
2 parents 5f85cf8 + a5ff383 commit 6ba11f7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
## master (unreleased)
44

5+
**Warning**: this version will be the last to support Django 1.6 or 1.7. Starting of the next version, we'll only support 1.8+.
6+
57
- Added Django 1.9 support (#9).
68
- Python 3.4 jobs are being tested in travis (#10).
9+
- Deprecate Django 1.6 and 1.7 support (#9).
710

811
## 1.0.0 (2016-06-23)
912

chunkator/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
"""
22
Toolbox for chunking / slicing querysets
33
"""
4+
import warnings
5+
6+
from distutils.version import StrictVersion
7+
import django
8+
9+
if StrictVersion(django.get_version()) < StrictVersion('1.8.0'):
10+
with warnings.catch_warnings():
11+
# This will force the warning to be triggered.
12+
warnings.simplefilter("always")
13+
warnings.warn(
14+
"Django 1.7 and lower versions will soon be deprecated. Please upgrade.", # noqa
15+
PendingDeprecationWarning
16+
)
417

518

619
class MissingPkFieldException(Exception):

0 commit comments

Comments
 (0)