本文整理汇总了Python中forms.Form.get_checkbox方法的典型用法代码示例。如果您正苦于以下问题:Python Form.get_checkbox方法的具体用法?Python Form.get_checkbox怎么用?Python Form.get_checkbox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类forms.Form
的用法示例。
在下文中一共展示了Form.get_checkbox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from forms import Form [as 别名]
# 或者: from forms.Form import get_checkbox [as 别名]
def main(self, msg=''):
users = cfg.users.keys()
add_form = Form(title=_("Edit or Delete User"), action="/sys/users/edit", message=msg)
add_form.html('<span class="indent"><strong>Delete</strong><br /></span>')
for uname in sorted(users.keys()):
add_form.html('<span class="indent"> %s ' %
add_form.get_checkbox(name=uname) +
'<a href="/sys/users/edit?username=%s">%s (%s)</a><br /></span>' %
(uname, users[uname]['name'], uname))
add_form.submit(label=_("Delete User"), name="delete")
return add_form.render()
示例2: main
# 需要导入模块: from forms import Form [as 别名]
# 或者: from forms.Form import get_checkbox [as 别名]
def main(self, msg=''):
users = cfg.users.get_all()
add_form = Form(title=_("Edit or Delete User"), action=cfg.server_dir + "/sys/users/edit", message=msg)
add_form.html('<span class="indent"><strong>Delete</strong><br /></span>')
for uname in users:
user = User(uname[1])
add_form.html('<span class="indent"> %s ' %
add_form.get_checkbox(name=user['username']) +
'<a href="'+cfg.server_dir+'/sys/users/edit?username=%s">%s (%s)</a><br /></span>' %
(user['username'], user['name'], user['username']))
add_form.submit(label=_("Delete User"), name="delete")
return add_form.render()