diff --git a/CHANGELOG.md b/CHANGELOG.md index bd067e2..5cd7ad8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.4.0 +* Add Django 2.0 support #23 +* Drop support for Django 1.8 + ## 0.3.3 * Fix multipart form data (@ron8mcr) diff --git a/README.md b/README.md index ebdc728..2e7e2c4 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Requirements ============ - Python (2.7, 3.5, 3.6) -- Django (1.8, 1.9, 1.10, 1.11) +- Django (1.9, 1.10, 1.11, 2.0) - djangorestframework (3.5+) Installation diff --git a/drf_writable_nested/__init__.py b/drf_writable_nested/__init__.py index 27a2ec6..b6fdd69 100644 --- a/drf_writable_nested/__init__.py +++ b/drf_writable_nested/__init__.py @@ -1,5 +1,5 @@ __title__ = 'DRF writable nested' -__version__ = '0.3.3' +__version__ = '0.4.0' __author__ = 'beda.software' __license__ = 'BSD 2-Clause' __copyright__ = 'Copyright 2014-2018 beda.software' diff --git a/drf_writable_nested/mixins.py b/drf_writable_nested/mixins.py index 64f3b75..8419b02 100644 --- a/drf_writable_nested/mixins.py +++ b/drf_writable_nested/mixins.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import uuid from collections import OrderedDict, defaultdict from django.contrib.contenttypes.fields import GenericRelation @@ -264,7 +263,7 @@ def delete_reverse_relations_if_need(self, instance, reverse_relations): if related_field.many_to_many and \ not isinstance(related_field, ForeignObjectRel): related_field_lookup = { - related_field.rel.name: instance, + related_field.remote_field.name: instance, } elif isinstance(related_field, GenericRelation): related_field_lookup = \ diff --git a/tox.ini b/tox.ini index ac6763c..ccbef87 100644 --- a/tox.ini +++ b/tox.ini @@ -3,14 +3,16 @@ addopts=--tb=short [tox] envlist = - {py27,py35}-dj{18,19}-drf{35,36} - {py27,py35,py36}-dj{110,111}-drf{35,36,37} + py{27,35}-dj{19}-drf{35,36} + py{27,35,36}-dj{110,111}-drf{35,36,37} + py{36}-dj{20}-drf{37} + [travis:env] DJANGO = - 1.8: dj18 1.9: dj19 1.10: dj110 1.11: dj111 + 2.0: dj20 [testenv] commands = ./py.test --cov drf_writable_nested @@ -18,10 +20,10 @@ setenv = PYTHONDONTWRITEBYTECODE=1 PYTHONWARNINGS=once deps = - dj18: Django>=1.8,<1.9 dj19: Django>=1.9,<1.10 dj110: Django>=1.10,<1.11 dj111: Django>=1.11a1,<2.0 + dj20: Django>=2.0,<2.1 drf35: djangorestframework>=3.5,<3.6 drf36: djangorestframework>=3.6.0,<3.7 drf37: djangorestframework>=3.7.0,<3.8