Skip to content

Commit

Permalink
Merge pull request #132 from uploadcare/feature/django20-support
Browse files Browse the repository at this point in the history
django 2.0 support
  • Loading branch information
andrewshkovskii committed Mar 12, 2018
2 parents b13b6c7 + cb0be29 commit 87dae69
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 9 deletions.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
sudo: false
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
env:
global:
- SUITE="tests/functional"
matrix:
- DJANGO=1.8
- DJANGO=1.9
- DJANGO=1.10
- DJANGO=1.11
- DJANGO=2.0
matrix:
include:
- python: 2.6
Expand All @@ -26,6 +28,14 @@ matrix:
env: DJANGO=1.6
- python: 2.7
env: DJANGO=1.7
- python: 2.7
env: DJANGO=1.8
- python: 2.7
env: DJANGO=1.9
- python: 2.7
env: DJANGO=1.10
- python: 2.7
env: DJANGO=1.11

- python: 3.3
env: DJANGO=1.8
Expand Down
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
History
-------

2.3.0
~~~~~

- Add support for django versions 1.11 and ~2.0
- Miscellaneous updates(version, year in a license file, tox configuration and etc.)

2.2.1
~~~~~

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Uploadcare, LLC
Copyright (c) 2018 Uploadcare, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Features
Requirements
------------

``pyuploadcare`` requires Python 2.6, 2.7, 3.3, 3.4 or 3.5.
``pyuploadcare`` requires Python 2.6, 2.7, 3.3, 3.4, 3.5 or 3.6

If you're using ``pyuploadcare`` with Django, check ``.travis.yml`` for supported
Python-Django combinations.
Expand Down Expand Up @@ -105,6 +105,7 @@ Contributors
- `@zerc`_
- `@homm`_
- `@va1en0k`_
- `@andreshkovskii`_

.. _Uploadcare: https://uploadcare.com/
.. _simple steps: https://pyuploadcare.readthedocs.org/en/latest/quickstart.html
Expand All @@ -117,3 +118,4 @@ Contributors
.. _@zerc: https://github.com/zerc
.. _@homm: https://github.com/homm
.. _@va1en0k: https://github.com/va1en0k
.. _@andreshkovskii: https://github.com/andrewshkovskii/
2 changes: 1 addition & 1 deletion pyuploadcare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from __future__ import unicode_literals

__version__ = '2.2.1'
__version__ = '2.3.0'

from .api_resources import File, FileList, FileGroup
from .exceptions import (
Expand Down
4 changes: 2 additions & 2 deletions pyuploadcare/dj/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_prep_value(self, value):
return value.cdn_url

def value_to_string(self, obj):
value = self._get_val_from_obj(obj)
value = self.value_from_object(obj)
return self.get_prep_value(value)

def formfield(self, **kwargs):
Expand Down Expand Up @@ -158,7 +158,7 @@ def get_prep_value(self, value):
return value.cdn_url

def value_to_string(self, obj):
value = self._get_val_from_obj(obj)
value = self.value_from_object(obj)
return self.get_prep_value(value)

def formfield(self, **kwargs):
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

setup(
name='pyuploadcare',
version='2.2.1',
version='2.3.0',
description='Python library for Uploadcare.com',
long_description=(long_description),
author='Uploadcare LLC',
Expand Down Expand Up @@ -58,6 +58,8 @@
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'License :: OSI Approved :: MIT License',
],
)
2 changes: 1 addition & 1 deletion tests/test_project/gallery/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __unicode__(self):

class Photo(models.Model):

gallery = models.ForeignKey(Gallery)
gallery = models.ForeignKey(Gallery, on_delete=models.CASCADE)
title = models.CharField(max_length=255)
arbitrary_file = FileField(blank=True, null=True)
photo_2x3 = ImageField(manual_crop='2:3', blank=True)
Expand Down
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist=py26-dj1.6,py27-dj1.{4,5,6,7,8,9,10},py{33}-dj1.8,py{34}-dj1.{8,9,10},py{35}-dj1.{8,9,10}
envlist=py26-dj1.6,py27-dj1.{4,5,6,7,8,9,10,11},py{33}-dj1.8,py3{4,5,6}-dj{1.8,1.9,1.10,1.11,2.0}

[testenv]
basepython =
Expand All @@ -8,6 +8,7 @@ basepython =
py33: python3.3
py34: python3.4
py35: python3.5
py36: python3.6
deps =
pytest
mock
Expand All @@ -19,5 +20,7 @@ deps =
dj1.8: Django~=1.8.0
dj1.9: Django~=1.9.0
dj1.10: Django~=1.10.0
dj1.11: Django~=1.11.0
dj2.0: Django~=2.0.0
commands =
py.test tests

0 comments on commit 87dae69

Please sign in to comment.