mlavin / django-selectable

Tools and widgets for using/creating auto-complete selection widgets using Django and jQuery UI.
http://django-selectable.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
129 stars 64 forks source link

Django 2.0 support #198

Closed vkurup closed 6 years ago

vkurup commented 6 years ago

This is mostly #190, with 1 commit added to add documentation and minor tox/travis configuration changes. There is one python warning remaining, which is probably best dealt with when we drop Django <1.11 support:

boundfield.py:41: RemovedInDjango21Warning: Add the `renderer` argument to the render() method of <class 'selectable.forms.widgets.AutoCompleteSelectMultipleWidget'>. It will be mandatory in Django 2.1.

:crossed_fingers: that this works on Travis (not sure if deadsnakes will work?)

codecov-io commented 6 years ago

Codecov Report

Merging #198 into master will decrease coverage by 0.48%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #198      +/-   ##
==========================================
- Coverage   95.45%   94.97%   -0.49%     
==========================================
  Files          10       10              
  Lines         374      378       +4     
==========================================
+ Hits          357      359       +2     
- Misses         17       19       +2
Impacted Files Coverage Δ
selectable/compat.py 75% <100%> (+25%) :arrow_up:
selectable/forms/fields.py 92.94% <0%> (-2.36%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 494013a...32b0be0. Read the comment docs.

mlavin commented 6 years ago

Thanks for this update! Is there any reason to keep <1.11 support around? Seems like it can all just :fire:

vkurup commented 6 years ago

awesome, I love deleting things!! I'll ping you when it's updated.

kluchrj commented 6 years ago

One thing I've found while testing this:

https://github.com/mlavin/django-selectable/blob/494013a6e5e1336fd841edfb43f92eb146138014/selectable/decorators.py#L53

https://github.com/mlavin/django-selectable/blob/494013a6e5e1336fd841edfb43f92eb146138014/selectable/decorators.py#L61

Django 2.0 no longer supports the user.is_authenticated() method, this needs to be changed to a property (user.is_authenticated).

mlavin commented 6 years ago

That's a good point @kluchrj. I don't think that is caught by the test suite because of the heavy use of Mocks. That should also be addressed.

kluchrj commented 6 years ago

@vkurup, not sure if you're still working on this, but I've stripped out all the <1.11 compat and fixed the issue mentioned above in my fork: https://github.com/kluchrj/django-selectable/tree/deprecations

Should I submit a pull request to replace this one?

vkurup commented 6 years ago

I have not had time to update this, so yes, please do submit a PR. Thanks!

vkurup commented 6 years ago

Superceded by #199