本文整理汇总了Python中uni_form.helpers.FormHelper.form_style方法的典型用法代码示例。如果您正苦于以下问题:Python FormHelper.form_style方法的具体用法?Python FormHelper.form_style怎么用?Python FormHelper.form_style使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uni_form.helpers.FormHelper
的用法示例。
在下文中一共展示了FormHelper.form_style方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: helper
# 需要导入模块: from uni_form.helpers import FormHelper [as 别名]
# 或者: from uni_form.helpers.FormHelper import form_style [as 别名]
def helper(self):
helper = FormHelper()
helper.add_input(Submit('submit', _('Submit!')))
layout = Layout(
Fieldset('',
'name', 'description'),
Fieldset(_('When and where'),
'date', 'time',
'town', 'other_town',
'place',
),
Fieldset(_('Details'),
'organizer', 'link', 'contact', 'image',
),
)
helper.add_layout(layout)
helper.form_action = reverse('agenda:create')
helper.form_method = 'post'
helper.form_style = 'inline'
return helper
示例2: reverse
# 需要导入模块: from uni_form.helpers import FormHelper [as 别名]
# 或者: from uni_form.helpers.FormHelper import form_style [as 别名]
'title',
'name',
'email',
'url',
'comment',
'honeypot'
)
)
comment_form_helper.add_layout(comment_form_layout)
comment_form_helper.form_action = reverse('comments-post-comment')
comment_form_helper.form_method = 'POST'
comment_form_helper.add_input(Submit('post','Post'))
comment_form_helper.add_input(Submit('preview','Preview'))
search_form_helper = FormHelper()
search_form_layout = Layout(
Fieldset('',
'q',
'models'
)
)
search_form_helper.add_layout(search_form_layout)
search_form_helper.form_style = 'inline'
search_form_helper.form_method = 'GET'
search_form_helper.add_input(Submit('post','Search'))