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 1.11 Support #187

Closed mlavin closed 6 years ago

mlavin commented 7 years ago

The template based widget rendering is causing a number of issues for this project (at least in the test suite): https://docs.djangoproject.com/en/1.11/releases/1.11/#template-based-widget-rendering This seems like a non-trivial amount of work and may require dropping support for older Django versions.

raphaelmerx commented 7 years ago

In Django 1.11, the signature of widget.build_attrs was changed from (self, extra_attrs=None, **kwargs) to (self, base_attrs, extra_attrs=None). Adapting the signature of widgets present in this project fixes the tests on Django 1.11. See this branch: https://github.com/mlavin/django-selectable/compare/master...raphaelmerx:django_111?expand=1

To do:

spookylukey commented 7 years ago

I have addressed the crashing bugs in widget rendering in my PR #189

I didn't use @raphaelmerx 's branch as a start, since the strategy needs to be quite different to achieve compat with both 1.11 and earlier. I also didn't address deprecation warnings in unrelated things, but that can wait for another PR.

spookylukey commented 7 years ago

I've found that while the above is necessary for supporting 1.11, it's not enough.

In particular, the new template based widget rendering in 1.11 means that for multiwidgets, the 'render' method of the subwidgets does not get called. This means that LookupMultipleHiddenInput.render does not get called, resulting in bugs. I have a test that demonstrates this, but a fix is harder.

vkurup commented 6 years ago

I think this can be closed now that #189 has been merged, and version 1.1 released

mlavin commented 6 years ago

:+1: