开发者

django custom form template checkbox question

Django forms are really easy and nice to style especially if you like to take control of the outcom开发者_C百科e.

A question. Is there anyway you can see whether the {{ field }} type, ie checkbox, radio etc?


you could create a field_type template filter

{{ field|field_type }} = CharField 
{{ field|widget_type }} = TextInput

heres a great example :

http://olivergeorge.posterous.com/django-template-tags-to-find-out-field-type

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜