Skip to content

Commit 0d1ba8f

Browse files
David Krauthdakrauth
authored andcommitted
Added Django 2.1, 2.2 to test matrix with simple fixes
1 parent 4045c53 commit 0d1ba8f

3 files changed

Lines changed: 24 additions & 12 deletions

File tree

djxml/xmlmodels/base.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,24 @@ def __new__(cls, name, bases, attrs):
7070

7171
new_class.add_to_class('_meta', Options(meta, **kwargs))
7272

73-
new_class.add_to_class('DoesNotExist', subclass_exception('DoesNotExist',
74-
tuple(x.DoesNotExist
75-
for x in parents if hasattr(x, '_meta'))
76-
or (ObjectDoesNotExist,), module))
77-
new_class.add_to_class('MultipleObjectsReturned', subclass_exception('MultipleObjectsReturned',
78-
tuple(x.MultipleObjectsReturned
79-
for x in parents if hasattr(x, '_meta'))
80-
or (MultipleObjectsReturned,), module))
73+
new_class.add_to_class(
74+
'DoesNotExist',
75+
subclass_exception(
76+
'DoesNotExist',
77+
tuple(
78+
x.DoesNotExist for x in parents if hasattr(x, '_meta')
79+
) or (ObjectDoesNotExist,),
80+
module,
81+
attached_to=new_class))
82+
new_class.add_to_class(
83+
'MultipleObjectsReturned',
84+
subclass_exception(
85+
'MultipleObjectsReturned',
86+
tuple(
87+
x.MultipleObjectsReturned for x in parents if hasattr(x, '_meta')
88+
) or (MultipleObjectsReturned,),
89+
module,
90+
attached_to=new_class))
8191

8292
# Bail out early if we have already created this class.
8393
m = get_xml_model(new_class._meta.app_label, name, False)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
setup(
2121
name='django-xml',
22-
version="2.0.2",
22+
version="2.1.0",
2323
install_requires=[
2424
'lxml',
2525
'pytz',

tox.ini

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist =
3-
{py27}-django{111}
4-
{py35,py36,py37}-django{111,20}
3+
py27-django111
4+
{py35,py36,py37}-django{111,20,21,22}
55

66
[testenv]
77
commands =
@@ -10,12 +10,14 @@ deps =
1010
six>=1.9.0
1111
django111: Django>=1.11,<2
1212
django20: Django>=2.0,<2.1
13+
django21: Django>=2.1,<2.2
14+
django22: Django>=2.2,<3.0
1315

1416
[testenv:pep8]
1517
description = Run PEP8 pycodestyle (flake8) against the djxml/ package directory
1618
skipsdist = true
1719
skip_install = true
18-
basepython = python3.6
20+
basepython = python3.7
1921
deps = pycodestyle
2022
commands = pycodestyle djxml
2123

0 commit comments

Comments
 (0)