[英]Django-autocomplete-light: allow free text
I am using autocomplete_light.MultipleChoiceWidget
from django-autocomplete-light==1.4.13
to fill in a ManyToManyField. 我使用autocomplete_light.MultipleChoiceWidget
从django-autocomplete-light==1.4.13
填写一个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? 有没有一种方法允许用户使用django-autocomplete-light快速创建新项目?
If not, is there any solid alternative to it with good Django integration, which supports this feature? 如果不是,是否有任何可靠的替代方法可以通过良好的Django集成来支持此功能?
There is an issue on GitHub by @blueyed. @blueyed 在GitHub上存在问题 。 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 这是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 那将是针对v1的https://github.com/yourlabs/django-autocomplete-light/tree/master/test_project/ajax_create
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.