Skip to content

Commit

Permalink
Add support for Django 1.11.
Browse files Browse the repository at this point in the history
Also, drop support for Django < 1.8. Refs #91.
  • Loading branch information
slurms committed Apr 9, 2017
1 parent 0aa5836 commit 1e96570
Show file tree
Hide file tree
Showing 22 changed files with 661 additions and 1,032 deletions.
142 changes: 16 additions & 126 deletions .travis.yml
Expand Up @@ -7,147 +7,37 @@ language: python
matrix:
include:
- python: "2.7"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=2.3.14
env: DJANGO_VERSION=1.8.18 REST_FRAMEWORK_VERSION=3.5.3
- python: "2.7"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=2.4.8
env: DJANGO_VERSION=1.9.13 REST_FRAMEWORK_VERSION=3.5.3
- python: "2.7"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=3.0.5
env: DJANGO_VERSION=1.10.7 REST_FRAMEWORK_VERSION=3.5.3
- python: "2.7"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=3.1.3
- python: "2.7"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=3.2.5
- python: "2.7"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=3.3.3
- python: "2.7"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=2.3.14
- python: "2.7"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=2.4.8
- python: "2.7"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.0.5
- python: "2.7"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.1.3
- python: "2.7"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.2.5
- python: "2.7"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.3.3
- python: "2.7"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.4.7
- python: "2.7"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.5.3
- python: "2.7"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.1.3
- python: "2.7"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.2.5
- python: "2.7"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.3.3
- python: "2.7"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.4.7
- python: "2.7"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.5.3
- python: "2.7"
env: DJANGO_VERSION=1.10 REST_FRAMEWORK_VERSION=3.4.7
- python: "2.7"
env: DJANGO_VERSION=1.10 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.4"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=2.3.14
- python: "3.4"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=2.4.8
- python: "3.4"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=3.0.5
- python: "3.4"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=3.1.3
- python: "3.4"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=3.2.5
- python: "3.4"
env: DJANGO_VERSION=1.7.11 REST_FRAMEWORK_VERSION=3.3.3
- python: "3.4"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=2.3.14
- python: "3.4"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=2.4.8
- python: "3.4"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.0.5
- python: "3.4"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.1.3
- python: "3.4"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.2.5
env: DJANGO_VERSION=1.11 REST_FRAMEWORK_VERSION=3.6.2
- python: "3.4"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.3.3
env: DJANGO_VERSION=1.8.18 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.4"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.4.7
env: DJANGO_VERSION=1.9.13 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.4"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.5.3
env: DJANGO_VERSION=1.10.7 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.4"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.1.3
- python: "3.4"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.2.5
- python: "3.4"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.3.3
- python: "3.4"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.4.7
- python: "3.4"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.4"
env: DJANGO_VERSION=1.10 REST_FRAMEWORK_VERSION=3.4.7
- python: "3.4"
env: DJANGO_VERSION=1.10 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.5"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=2.3.14
- python: "3.5"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=2.4.8
- python: "3.5"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.0.5
- python: "3.5"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.1.3
- python: "3.5"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.2.5
- python: "3.5"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.3.3
- python: "3.5"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.4.7
- python: "3.5"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.5.3
env: DJANGO_VERSION=1.11 REST_FRAMEWORK_VERSION=3.6.2
- python: "3.5"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.1.3
env: DJANGO_VERSION=1.8.18 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.5"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.2.5
env: DJANGO_VERSION=1.9.13 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.5"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.3.3
env: DJANGO_VERSION=1.10.7 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.5"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.4.7
- python: "3.5"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.5"
env: DJANGO_VERSION=1.10 REST_FRAMEWORK_VERSION=3.4.7
- python: "3.5"
env: DJANGO_VERSION=1.10 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.6"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=2.4.8
- python: "3.6"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.0.5
- python: "3.6"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.1.3
- python: "3.6"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.2.5
- python: "3.6"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.3.3
- python: "3.6"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.4.7
- python: "3.6"
env: DJANGO_VERSION=1.8.12 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.6"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.1.3
- python: "3.6"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.2.5
- python: "3.6"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.3.3
env: DJANGO_VERSION=1.11 REST_FRAMEWORK_VERSION=3.6.2
- python: "3.6"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.4.7
env: DJANGO_VERSION=1.8.18 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.6"
env: DJANGO_VERSION=1.9.5 REST_FRAMEWORK_VERSION=3.5.3
env: DJANGO_VERSION=1.9.13 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.6"
env: DJANGO_VERSION=1.10 REST_FRAMEWORK_VERSION=3.4.7
env: DJANGO_VERSION=1.10.7 REST_FRAMEWORK_VERSION=3.5.3
- python: "3.6"
env: DJANGO_VERSION=1.10 REST_FRAMEWORK_VERSION=3.5.3
env: DJANGO_VERSION=1.11 REST_FRAMEWORK_VERSION=3.6.2
before_install:
- export DJANGO_SETTINGS_MODULE=tests.test_settings
# Tell it the things it will need to install when it boots
Expand Down
6 changes: 4 additions & 2 deletions README.rst
Expand Up @@ -32,18 +32,19 @@ Compatibility
- 2.7
- 3.4
- 3.5
- 3.6
- 3.6

**NOTE**: The 1.2 release dropped support for Python 3.3.x.

- `Django <https://www.djangoproject.com/>`_:

- 1.7.x
- 1.8.x
- 1.9.x (NOTE: Django REST Framework>=3.1.x is required if using Django 1.9.x)
- 1.10.x
- 1.11.x

**NOTE**: The 1.4 release dropped support for Django 1.5.x & 1.6.x.
**NOTE**: The 1.7 release dropped support for Django 1.7.x.

- `Pillow <https://pillow.readthedocs.io/en/latest/index.html>`_ >= 2.4.0

Expand All @@ -57,6 +58,7 @@ Compatibility
- 3.3.x (NOTE: Django REST Framework 3.3.x is not compatible with Django<=1.6.x)
- 3.4.x
- 3.5.x
- 3.6.x

Documentation
=============
Expand Down
7 changes: 7 additions & 0 deletions docs/index.rst
Expand Up @@ -49,8 +49,10 @@ Compatibility
- 1.8.x
- 1.9.x
- 1.10.x
- 1.11.x

.. note:: The 1.4 release dropped support for Django 1.5.x & 1.6.x.
.. note:: The 1.7 release dropped support for Django 1.7.x.

- `Pillow <https://pillow.readthedocs.io/en/latest/index.html>`_ >=2.4.0,<=4.0.0

Expand All @@ -64,6 +66,7 @@ Compatibility
- 3.3.x (NOTE: Django REST Framework 3.3.x is not compatible with Django<=1.6.x)
- 3.4.x (NOTE: Django REST Framework 3.4.x is not compatible with Django<=1.6.x)
- 3.5.x (NOTE: Django REST Framework 3.4.x is not compatible with Django<=1.7.x)
- 3.6.x

Code
====
Expand All @@ -90,6 +93,10 @@ Table of Contents
Release Notes
=============

1.7.0
^^^^^
- Added support for Django 1.11.

1.6.3
^^^^^
- Added support for Pillow 4.0 and Python 3.6 (thanks, `@aleksihakli <https://github.com/aleksihakli>`_!)
Expand Down
7 changes: 5 additions & 2 deletions docs/installation.rst
Expand Up @@ -13,13 +13,16 @@ Python Compatibility
- 2.7.x
- 3.3.x
- 3.4.x
- 3.5.x
- 3.6.x

Django Compatibility
--------------------

- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
- 1.10.x
- 1.11.x

Dependencies
------------
Expand Down
3 changes: 1 addition & 2 deletions runtests.py
Expand Up @@ -9,8 +9,7 @@
if __name__ == "__main__":
# Run Main Tests
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings'
if django.VERSION[1] >= 7:
django.setup()
django.setup()
from django.test.utils import get_runner
TestRunner = get_runner(settings)
test_runner = TestRunner()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -5,7 +5,7 @@
setup(
name='django-versatileimagefield',
packages=find_packages(),
version='1.6.3',
version='1.7.0',
author=u'Jonathan Ellenberger',
author_email='jonathan_ellenberger@wgbh.org',
url='http://github.com/respondcreate/django-versatileimagefield/',
Expand All @@ -29,10 +29,10 @@
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.7',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
Expand Down
17 changes: 15 additions & 2 deletions tests/admin.py
@@ -1,7 +1,7 @@
from django.contrib import admin
from django.forms import ModelForm

from versatileimagefield.widgets import VersatileImagePPOISelectWidget
from versatileimagefield.widgets import ClearableFileInputWithImagePreview, VersatileImagePPOISelectWidget

from .models import VersatileImageTestModel, VersatileImageWidgetTestModel

Expand All @@ -22,9 +22,22 @@ class Meta:
}


class VersatileImageWidgetTestModelForm(ModelForm):

class Meta:
model = VersatileImageWidgetTestModel
fields = '__all__'
widgets = {
'optional_image_2': ClearableFileInputWithImagePreview(),
}


class VersatileImageTestModelAdmin(admin.ModelAdmin):
form = VersatileImageTestModelForm


class VersatileImageWidgetTestModelAdmin(admin.ModelAdmin):
form = VersatileImageWidgetTestModelForm

admin.site.register(VersatileImageTestModel, VersatileImageTestModelAdmin)
admin.site.register(VersatileImageWidgetTestModel)
admin.site.register(VersatileImageWidgetTestModel, VersatileImageWidgetTestModelAdmin)

0 comments on commit 1e96570

Please sign in to comment.