如何自定义变形表格? [英] How to custom the deform Form?

查看:132
本文介绍了如何自定义变形表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用默认的变形窗体时.这不是我所需要的.

When I use the default deform Form. It's not what I need.

如何自定义它?

例如,我需要这个:

firstname:[_______]  lastname:[_______]
*username: [____________________] alink

其中[ _ _]代表普通的html输入.

where [__] represent normal html input.

是否应该重写模板?

推荐答案

这是一个CSS问题,要为变形输入提供自定义CSS类,您需要使用以下代码:

This is a css issue, to provide a custom CSS class to a deform input you need to use the following:

text_input = deform.widget.TextInputWidget(
    css_class='yourdivnamehere')

然后在内部变形,您可以:

Then inside deform you can:

first_name = colander.SchemaNode(colander.String(),
            widget = text_input)

这篇关于如何自定义变形表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆