Skip to content

Commit

Permalink
Merge pull request #3450 from tomchristie/django-19-alpha
Browse files Browse the repository at this point in the history
Django 1.9 support
  • Loading branch information
tomchristie committed Sep 28, 2015
2 parents c4211ce + 02e1f69 commit 3d7740f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 35 deletions.
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ sudo: false
env:
- TOX_ENV=py27-lint
- TOX_ENV=py27-docs
- TOX_ENV=py35-django19
- TOX_ENV=py34-django19
- TOX_ENV=py27-django19
- TOX_ENV=py34-django18
- TOX_ENV=py33-django18
- TOX_ENV=py32-django18
Expand All @@ -13,16 +16,12 @@ env:
- TOX_ENV=py33-django17
- TOX_ENV=py32-django17
- TOX_ENV=py27-django17
- TOX_ENV=py27-djangomaster
- TOX_ENV=py34-djangomaster
- TOX_ENV=py35-djangomaster

matrix:
# Python 3.5 not yet available on travis, watch this to see when it is.
fast_finish: true
allow_failures:
- env: TOX_ENV=py27-djangomaster
- env: TOX_ENV=py34-djangomaster
- env: TOX_ENV=py35-djangomaster
- env: TOX_ENV=py35-django19

install:
- pip install tox
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ There is a live example API for testing purposes, [available here][sandbox].

# Requirements

* Python (2.7, 3.2, 3.3, 3.4)
* Django (1.7, 1.8)
* Python (2.7, 3.2, 3.3, 3.4, 3.5)
* Django (1.7, 1.8, 1.9)

# Installation

Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ Some reasons you might want to use REST framework:

REST framework requires the following:

* Python (2.6.5+, 2.7, 3.2, 3.3, 3.4)
* Django (1.5.6+, 1.6.3+, 1.7+, 1.8)
* Python (2.6.5+, 2.7, 3.2, 3.3, 3.4, 3.5)
* Django (1.7+, 1.8, 1.9)

The following packages are optional:

Expand Down
8 changes: 8 additions & 0 deletions rest_framework/utils/field_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ def get_field_kwargs(field_name, model_field):
kwargs['choices'] = model_field.choices
return kwargs

# Our decimal validation is handled in the field code, not validator code.
# (In Django 1.9+ this differs from previous style)
if isinstance(model_field, models.DecimalField):
validator_kwarg = [
validator for validator in validator_kwarg
if not isinstance(validator, validators.DecimalValidator)
]

# Ensure that max_length is passed explicitly as a keyword arg,
# rather than as a validator.
max_length = getattr(model_field, 'max_length', None)
Expand Down
50 changes: 25 additions & 25 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ addopts=--tb=short
envlist =
py27-{lint,docs},
{py27,py32,py33,py34}-django{17,18},
{py27,py34,py35}-django{master}
{py27,py34,py35}-django{19}

[testenv]
basepython =
Expand All @@ -19,42 +19,42 @@ commands = ./runtests.py --fast {posargs} --coverage
setenv =
PYTHONDONTWRITEBYTECODE=1
deps =
django17: Django==1.7.10 # Should track maximum supported
django18: Django==1.8.4 # Should track maximum supported
djangomaster: https://github.com/django/django/archive/master.tar.gz
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt
django17: Django==1.7.10 # Should track maximum supported
django18: Django==1.8.4 # Should track maximum supported
django19: https://www.djangoproject.com/download/1.9a1/tarball/
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt

[testenv:py27-lint]
commands = ./runtests.py --lintonly
deps =
-rrequirements/requirements-codestyle.txt
-rrequirements/requirements-testing.txt
-rrequirements/requirements-codestyle.txt
-rrequirements/requirements-testing.txt

[testenv:py27-docs]
commands = mkdocs build
deps =
-rrequirements/requirements-testing.txt
-rrequirements/requirements-documentation.txt

# Specify explicitly to exclude Django Guardian against Django master (various Pythons)
[testenv:py27-djangomaster]
deps =
https://github.com/django/django/archive/master.tar.gz
-rrequirements/requirements-testing.txt
markdown==2.5.2
django-filter==0.10.0
[testenv:py34-djangomaster]
# Specify explicitly to exclude Django Guardian against Django 1.9
[testenv:py27-django19]
deps =
https://github.com/django/django/archive/master.tar.gz
-rrequirements/requirements-testing.txt
markdown==2.5.2
django-filter==0.10.0
https://www.djangoproject.com/download/1.9a1/tarball/
-rrequirements/requirements-testing.txt
markdown==2.5.2
django-filter==0.10.0

[testenv:py35-djangomaster]
[testenv:py34-django19]
deps =
https://github.com/django/django/archive/master.tar.gz
-rrequirements/requirements-testing.txt
markdown==2.5.2
django-filter==0.10.0
https://www.djangoproject.com/download/1.9a1/tarball/
-rrequirements/requirements-testing.txt
markdown==2.5.2
django-filter==0.10.0

[testenv:py35-django19]
deps =
https://www.djangoproject.com/download/1.9a1/tarball/
-rrequirements/requirements-testing.txt
markdown==2.5.2
django-filter==0.10.0

0 comments on commit 3d7740f

Please sign in to comment.