将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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在sqlite数据库中保存特定列的历史记录   java如何更改/更新timeseriechart名称(JFreeChart)   java如何将整数转换为可绘制的   汇编什么解释Java的字节码   java查找已编译的类版本号   我应该什么时候在ColdFusion应用程序中使用Java?   java当一个实体的两个字段为(unique=true)时,如何处理JPA异常?   java为什么在所有其他实例都正确的情况下返回错误的布尔值?   java Hibernate每次都准备语句   java停留在平均字长上   对Java和日语字符进行编码   java如何将导致异常的方法的错误消息传递给侦听器中的onTestFailure方法   java代码没有打印结果   java为什么私有内部接口的方法必须是公共的?   休眠发生错误。有关详细信息,请参阅错误日志。JAVAlang.NullPointerException