Support Django 1.9 #160

Merged
merged 5 commits into from Sep 28, 2015

Projects

None yet

3 participants

@jonashaag
Contributor

No description provided.

@gregmuellegger gregmuellegger commented on the diff Sep 22, 2015
@@ -17,6 +18,7 @@ deps =
16: Django >= 1.6, < 1.7
17: Django >= 1.7, < 1.8
18: Django >= 1.8, < 1.9
+ 19: https://github.com/django/django/tarball/master
@gregmuellegger
gregmuellegger Sep 22, 2015 Owner

We should add the Django 1.9 tests to the .travis.yml file as well to make sure that the tests also run in CI.

@gregmuellegger gregmuellegger commented on an outdated diff Sep 22, 2015
floppyforms/widgets.py
@@ -12,7 +12,13 @@
from django.forms.widgets import FILE_INPUT_CONTRADICTION
from django.conf import settings
from django.template import loader
-from django.utils.datastructures import MultiValueDict, MergeDict
+try:
+ from django.utils.datastructures import MultiValueDict, MergeDict
+ MULTIVALUE_DICT_TYPES = (MultiValueDict, MergeDict)
+except ImportError:
+ # Django >= 1.9
+ from django.utils.datastructures import MultiValueDict
+ MULTIVALUE_DICT_TYPES = (MultiValueDict,)
@gregmuellegger
gregmuellegger Sep 22, 2015 Owner

I like to keep logic that forks on different Django versions in a compat.py file. We should stick this try/except in this file: https://github.com/gregmuellegger/django-floppyforms/blob/master/floppyforms/compat.py

@gregmuellegger gregmuellegger commented on the diff Sep 22, 2015
floppyforms/fields.py
'GenericIPAddressField', 'TypedChoiceField', 'FilePathField',
'TypedMultipleChoiceField', 'ComboField', 'MultiValueField',
'SplitDateTimeField',
)
+if django.VERSION < (1, 9):
@gregmuellegger
gregmuellegger Sep 22, 2015 Owner

I would move this down to the class IPAddressField definition to keep the logic for the field together. Otherwise we might forget removing statement once we drop Django 1.8 support.

@jonashaag
jonashaag Sep 23, 2015 Contributor

I disagree: I'd rather keep all of the code related to __all__ in one place

@gregmuellegger
gregmuellegger Sep 24, 2015 Owner

Could live with it :)

@gregmuellegger
Owner

Hi! Awesome to propose this pull request and thanks for the work. I have commented in a few place in-line. Would you be able to make those changes, I'm happy to merge after that.

@gregmuellegger
Owner

The Python 3.2 tests are failing on TravisCI. But I'm happy to drop 3.2 support so don't worry about these. However, the flake8 check is failing as well. Would you like to tackle this? https://travis-ci.org/gregmuellegger/django-floppyforms/jobs/81732728

If not it's fine it should be minor enough that I will be able to add it after a merge.

@gregmuellegger gregmuellegger merged commit b4592ef into gregmuellegger:master Sep 28, 2015

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@gregmuellegger
Owner

Awesome work! Thanks so much for the PR.

@stefanw
stefanw commented Dec 2, 2015

Thanks everyone! Django 1.9 just got released, so if you have the time, please push a release to pypi.

@stefanw
stefanw commented Dec 4, 2015

🎉

@pyup-bot pyup-bot referenced this pull request in gamealerts/gamealerts.io Jan 25, 2017
Closed

Update django-floppyforms to 1.7.0 #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment