Better support for autocomplete inputs is planned in future versions. #7754
Replies: 6 comments
-
Integrating DAL with DF was nice: https://gist.github.com/jpic/e4f48295ab419d007826d1ab510a77a2 But DAL doesn't load jQuery, what's your recommendation here ? |
Beta Was this translation helpful? Give feedback.
-
The browsable API does include jQuery, so I assume that's not a problem. I guess that we'd need:
Presumably there also needs to be an autocomplete endpoint against which the search requests are issued, right? |
Beta Was this translation helpful? Give feedback.
-
@tomchristie - given that widgets now use templates for rendering, would it make sense to revert to using widgets in serializers? It would make integration w/ 3rd party packages like DAL fairly trivial. |
Beta Was this translation helpful? Give feedback.
-
@rpkilby depends on how it's done. I'm not willing to increase the coupling between |
Beta Was this translation helpful? Give feedback.
-
For cases like DAL, you would need to include field-specific information. eg, widget=autocomplete.ModelSelect2Multiple(url='posts:poster_autocomplete') I don't think this could be accomplished by the renderer alone, since it will lack that context. |
Beta Was this translation helpful? Give feedback.
-
Currently, In the DOM chronology, this happens before DRF's base.html loads jQuery, so, the filter form media cannot rely on the jQuery instance:
If only we could find a way to make the filter form media load after base.html loads jQuery, then users would just have to create filter sets as such:
And it will work ootb, provided they have registered a compatible autocomplete view on whatever Would this work for you ? I didn't understand why we'd need to create new templates though, are you talking about it for integration /without/ django-filter ? |
Beta Was this translation helpful? Give feedback.
-
I've seen in the documentation that:
I have found no open issue about it and the last discussion I found in the ML archives about autocompletes is from 2014.
Is it possible to start a discussion about what "better support for autocomplete inputs" would look like, and see what we can do in DAL or DRF to help ? (note: i maintain DAL since 2012, hence my personal interrest)
<3
Beta Was this translation helpful? Give feedback.
All reactions