Django-autocomplete-light: allow free text

雨燕双飞 提交于 2021-02-07 09:27:24

问题


I am using autocomplete_light.MultipleChoiceWidget from django-autocomplete-light==1.4.13 to fill in a ManyToManyField. It only allows selecting items from existing choices.

Is there a way to allow users to create new items on the fly with django-autocomplete-light?

If not, is there any solid alternative to it with good Django integration, which supports this feature?


回答1:


There is an issue on GitHub by @blueyed. Here is an answer from the author:

Here's an example for v2 https://github.com/yourlabs/django-autocomplete-light/tree/master/autocomplete_light/example_apps/create_choice_on_the_fly

That one would be for v1 https://github.com/yourlabs/django-autocomplete-light/tree/master/test_project/ajax_create



来源:https://stackoverflow.com/questions/24243853/django-autocomplete-light-allow-free-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!