Skip to content

Commit

Permalink
Support Django 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
blag committed Jan 29, 2018
1 parent a9ab873 commit 769e3e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
- DJANGO_VERSION='Django>=1.9,<1.10'
- DJANGO_VERSION='Django>=1.10,<1.11'
- DJANGO_VERSION='Django>=1.11,<2.0'
- DJANGO_VERSION='Django>=2.0,<2.1'
- DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'
matrix:
exclude:
Expand All @@ -29,8 +30,12 @@ matrix:
env: DJANGO_VERSION='Django>=1.10,<1.11'
- python: "2.6"
env: DJANGO_VERSION='Django>=1.11,<2.0'
- python: "2.6"
env: DJANGO_VERSION='Django>=2.0,<2.1'
- python: "2.6"
env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'
- python: "2.7"
env: DJANGO_VERSION='Django>=2.0,<2.1'
- python: "2.7"
env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'
- python: "3.3"
Expand All @@ -43,6 +48,8 @@ matrix:
env: DJANGO_VERSION='Django>=1.10,<1.11'
- python: "3.3"
env: DJANGO_VERSION='Django>=1.11,<2.0'
- python: "3.3"
env: DJANGO_VERSION='Django>=2.0,<2.1'
- python: "3.3"
env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'
- python: "3.4"
Expand Down
5 changes: 4 additions & 1 deletion multiselectfield/db/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def get_choices_selected(self, arr_choices):
return choices_selected

def value_to_string(self, obj):
value = self._get_val_from_obj(obj)
try:
value = self.val_from_object(obj)
except AttributeError:
value = self._get_val_from_obj(obj)
return self.get_prep_value(value)

def validate(self, value, model_instance):
Expand Down

0 comments on commit 769e3e1

Please sign in to comment.