我正在尝试将一些数据传递给autocomplete_light.AutocompleteModelBase
这样我就可以从搜索中排除某些型号。我正在尝试使用文档中的依赖项信息here http://django-autocomplete-light.readthedocs.org/en/latest/dependant.html
但我似乎能明白。
输入的id是id_alternate_version-autocomplete
,所以我正在尝试:
$("#id_alternate_version-autocomplete").yourlabsWidget().autocomplete.data = {'id': 'foo'};
但调用的网址看起来像http://127.0.0.1:8000/autocomplete/FooAutocomplete/?q=bar
I want: http://127.0.0.1:8000/autocomplete/FooAutocomplete/?q=bar&id=foo
我怎样才能做这样的事情呢?
DAL 提供了一种通过“转发”另一个呈现的表单字段的值来实现此目的的方法。
See http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#filtering-results-based-on-the-value-of-other-fields-in-the-form http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#filtering-results-based-on-the-value-of-other-fields-in-the-form
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)