将django model choice字段转换为typeahead字段。
django-bootstrap-typeahead的Python项目详细描述
#django bootstrap typeahead
将django model choice字段转换为typeahead字段。
[示例](http://thegoods.aj7may.com/content/images/2014/feb/screen-shot-2014-02-05-at-u-5-27-u-56-pm.png)安装:
pip install django bootstrap typeahead`
模板。_也一定要包括[twitter bootstrap(http://getbootstrap.com/)
{{{{{{form forms.py
{{{forms.py
/>
/>{def-build物(值):
物,
是的created=thing.objects.get_或_create(name=value)
返回thing
class testform(forms.form):
typeahead=typeaheadfield(
queryset=thing.objects.all(),
builder=build_thing
)
multi_typeahead=multipletypeheadfield(
queryset=thing.objects.all(),
builder=build_thing
)
将django model choice字段转换为typeahead字段。
[示例](http://thegoods.aj7may.com/content/images/2014/feb/screen-shot-2014-02-05-at-u-5-27-u-56-pm.png)安装:
pip install django bootstrap typeahead`
模板。_也一定要包括[twitter bootstrap(http://getbootstrap.com/)
{{{{{{form forms.py
{{{forms.py
/>
/>{def-build物(值):
物,
是的created=thing.objects.get_或_create(name=value)
返回thing
class testform(forms.form):
typeahead=typeaheadfield(
queryset=thing.objects.all(),
builder=build_thing
)
multi_typeahead=multipletypeheadfield(
queryset=thing.objects.all(),
builder=build_thing
)