当前位置: 首页>>代码示例>>Python>>正文


Python rules.len_of函数代码示例

本文整理汇总了Python中toughlib.btforms.rules.len_of函数的典型用法代码示例。如果您正苦于以下问题:Python len_of函数的具体用法?Python len_of怎么用?Python len_of使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了len_of函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: operator_add_form

def operator_add_form():
    return btforms.Form(
        btforms.Textbox("operator_name", rules.len_of(2, 32), description=u"操作员名称", required="required", **input_style),
        btforms.Textbox("operator_desc", rules.len_of(0, 255), description=u"操作员姓名", **input_style),
        btforms.Password("operator_pass", rules.len_of(6, 128), description=u"操作员密码", required="required",**input_style),
        btforms.Dropdown("operator_status", description=u"操作员状态", args=opr_status_dict.items(), required="required",**input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加操作员",
        action="/operator/add"
    )
开发者ID:gvsurenderreddy,项目名称:toughwlan,代码行数:10,代码来源:operator_form.py

示例2: contact_add_form

def contact_add_form(groups=[]):
    return btforms.Form(
        btforms.Dropdown("contactgroup_name", description=u"联系人组",args=groups,required="required",**input_style),
        btforms.Textbox("contact_name", rules.len_of(1, 128), description=u"联系人名称",required="required",**input_style),
        btforms.Textbox("alias", rules.len_of(1, 128), description=u"联系人描述",required="required",**input_style),
        btforms.Textbox("email", rules.len_of(1, 128), description=u"电子邮件",required="required",**input_style),
        btforms.Textbox("pager", rules.len_of(1, 128), description=u"手机号码",required="required",**input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"联系人增加",
        action="/contact/add"
    )()
开发者ID:lxyjyy,项目名称:ToughNMS,代码行数:11,代码来源:contact_form.py

示例3: operator_update_form

def operator_update_form():
    return btforms.Form(
        btforms.Hidden("id", description=u"编号"),
        btforms.Textbox("operator_name", description=u"操作员名称", readonly="readonly", **input_style),
        btforms.Textbox("operator_desc", rules.len_of(0, 255), description=u"操作员姓名", **input_style),
        btforms.Password("operator_pass", rules.len_of(0, 128), description=u"操作员密码(留空不修改)", autocomplete="off",**input_style),
        btforms.Dropdown("operator_status", description=u"操作员状态", args=opr_status_dict.items(), required="required",**input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"修改操作员",
        action="/operator/update"
    )
开发者ID:gvsurenderreddy,项目名称:toughwlan,代码行数:11,代码来源:operator_form.py

示例4: host_update_form

def host_update_form(groups=[]):
    return btforms.Form(
        btforms.Dropdown("use", description=u"主机类型",args=host_uses.items(),required="required",**input_style),
        btforms.Dropdown("group_name", description=u"主机分组",args=groups,required="required",**input_style),
        btforms.Textbox("host_name", rules.len_of(1, 128), description=u"主机名称",readonly="readonly",**input_style),
        btforms.Textbox("alias", rules.len_of(1, 128), description=u"主机描述",required="required",**input_style),
        btforms.Textbox("address", rules.len_of(1, 128), description=u"主机地址",required="required",**input_style),
        btforms.Dropdown("notifications_enabled", args=state.items(), description=u"启动通知",**input_style), 
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"主机修改",
        action="/host/update"
    )()
开发者ID:lxyjyy,项目名称:ToughNMS,代码行数:12,代码来源:host_form.py

示例5: isp_update_form

def isp_update_form():
    return btforms.Form(
        btforms.Textbox("isp_code", rules.len_of(4, 8), description=u"服务商编码", readonly="readonly", **input_style),
        btforms.Textbox("isp_name", rules.len_of(4, 64), description=u"服务商名称", **input_style),
        btforms.Textbox("isp_email", rules.len_of(0, 64), description=u"服务商Email", **input_style),
        btforms.Textbox("isp_phone", rules.len_of(0, 64), description=u"服务商电话", **input_style),
        btforms.Textbox("isp_idcard", rules.len_of(0, 32), description=u"服务商证件号码", **input_style),
        btforms.Textbox("isp_desc", description=u"服务商描述", **input_style),
        btforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style),
        title=u"修改服务商",
        action="/isp/update"
    )
开发者ID:gvsurenderreddy,项目名称:toughwlan,代码行数:12,代码来源:isp_forms.py

示例6: isp_add_form

def isp_add_form():
    return btforms.Form(
        btforms.Textbox("isp_code", rules.len_of(4, 8), description=u"服务商编码", required="required", **input_style),
        btforms.Textbox("isp_name", rules.len_of(4, 64), description=u"服务商名称", required="required", **input_style),
        btforms.Textbox("isp_email", rules.len_of(0, 64), description=u"服务商Email", **input_style),
        btforms.Textbox("isp_phone", rules.len_of(0, 64), description=u"服务商电话", **input_style),
        btforms.Textbox("isp_idcard", rules.len_of(0, 32), description=u"服务商证件号码", **input_style),
        btforms.Textbox("isp_desc", description=u"服务商描述", **input_style),
        btforms.Button("submit", type="submit", id="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加服务商",
        action="/isp/add"
    )
开发者ID:gvsurenderreddy,项目名称:toughwlan,代码行数:12,代码来源:isp_forms.py

示例7: operator_add_form

def operator_add_form(nodes=[], products=[]):
    return btforms.Form(
        btforms.Textbox("operator_name", rules.len_of(2, 32), description=u"操作员名称", required="required", **input_style),
        btforms.Textbox("operator_desc", rules.len_of(0, 255), description=u"操作员姓名", **input_style),
        btforms.Password("operator_pass", rules.len_of(6, 128), description=u"操作员密码", required="required",**input_style),
        btforms.Dropdown("operator_status", description=u"操作员状态", args=opr_status_dict.items(), required="required",**input_style),
        btforms.Dropdown("operator_nodes", description=u"关联区域(多选)", args=nodes, required="required",multiple="multiple", size=4, **input_style),
        btforms.Dropdown("operator_products", description=u"关联资费(多选)", args=products, required="required",multiple="multiple", size=6, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加操作员",
        action="/admin/operator/add"
    )
开发者ID:Evan-hu,项目名称:ToughRADIUS,代码行数:12,代码来源:operator_form.py

示例8: customer_update_form

def customer_update_form():
    return btforms.Form(
        btforms.Textbox("realname", description=u"用户姓名",readonly="readonly",**input_style),
        btforms.Textbox("customer_name", description=u"用户登陆名", readonly="readonly",**input_style),
        btforms.Password("new_password", rules.len_of(0,128),value="", description=u"用户登陆密码(留空不修改)", **input_style),
        btforms.Textbox("email", rules.len_of(0,128), description=u"电子邮箱", **input_style),
        # btforms.Textbox("idcard", rules.len_of(0,32), description=u"证件号码", **input_style),
        # btforms.Textbox("mobile", rules.len_of(0,32),description=u"用户手机号码", **input_style),
        btforms.Textbox("address", description=u"用户地址",hr=True, **input_style),
        btforms.Button("submit",  type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户基本信息修改",
        action="/customer/user/update"
    )
开发者ID:davislidaqing,项目名称:ToughRADIUS,代码行数:13,代码来源:forms.py

示例9: service_add_form

def service_add_form():
    return btforms.Form(
        btforms.Dropdown("use", description=u"服务类型",args=service_uses.items(),required="required",**input_style),
        btforms.Textbox("host_name", description=u"主机名称",readonly="readonly",**input_style),
        btforms.Textbox("service_description", rules.len_of(1, 128), description=u"服务描述",required="required",**input_style),
        btforms.Textbox("check_command", rules.len_of(1, 512), description=u"检测命令",required="required",help=u"命令参考",**input_style),
        btforms.Textbox("max_check_attempts", rules.is_number, description=u"最大重试次数",required="required",**input_style),
        btforms.Textbox("normal_check_interval", rules.is_number, description=u"检测间隔时间(分)",value=5, required="required",**input_style),
        btforms.Textbox("retry_check_interval", rules.is_number, description=u"重试间隔时间(分)",value=1,required="required",**input_style),
        btforms.Dropdown("notifications_enabled", args=state.items(), description=u"启动通知",**input_style),  
        btforms.Dropdown("process_perf_data", args=state.items(), description=u"启动性能统计",**input_style),              
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"服务增加",
        action="/service/add"
    )()
开发者ID:lxyjyy,项目名称:ToughNMS,代码行数:15,代码来源:service_form.py

示例10: customer_join_form

def customer_join_form(nodes=[]): 
    return btforms.Form(
        btforms.Dropdown("node_id", description=u"区域", args=nodes,required="required", **input_style),
        btforms.Textbox("realname", rules.len_of(2,32), description=u"用户姓名(必填)", required="required",**input_style),
        btforms.Dropdown("sex", description=u"性别", args=sexopt.items(),required="required", **input_style),
        btforms.Textbox("age", rules.is_number, description=u"年龄(必填)", size=3,required="required",**input_style),
        btforms.Textbox("username", rules.is_alphanum3(6, 32), description=u"用户名(必填)", size=32,required="required",**input_style),
        btforms.Password("password", rules.len_of(6,32), description=u"登录密码(必填)", size=32, required="required",**input_style),
        btforms.Textbox("email", rules.is_email, description=u"电子邮箱(必填)", size=64,required="required",**input_style),
        btforms.Textbox("idcard", rules.len_of(0,32), description=u"证件号码", **input_style),
        btforms.Textbox("mobile", rules.len_of(0,32),description=u"用户手机号码", **input_style),
        btforms.Textbox("address", description=u"用户地址",hr=True, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>注册</b>", **button_style),
        action="/customer/join",
        title=u"用户注册"
    )
开发者ID:davislidaqing,项目名称:ToughRADIUS,代码行数:16,代码来源:forms.py

示例11: bas_add_form

def bas_add_form(isps=[]):
    return btforms.Form(
        btforms.Dropdown("isp_code", isps, description=u"服务商", required="required", **input_style),
        btforms.Textbox("ip_addr", rules.is_ip, description=u"设备地址", required="required", **input_style),
        btforms.Textbox("bas_name", rules.len_of(2, 64), description=u"设备名称", required="required", **input_style),
        btforms.Textbox("dns_name", rules.len_of(1, 128), description=u"DNS域名", help=u"动态IP专用", **input_style),
        btforms.Textbox("bas_secret", rules.is_alphanum2(4, 32), description=u"共享秘钥", required="required", **input_style),
        btforms.Dropdown("vendor_id", description=u"设备类型", args=bastype.items(), required="required", **input_style),
        btforms.Dropdown("portal_vendor", description=u"portal协议", args=portaltype.items(), required="required", **input_style),
        btforms.Dropdown("time_type", description=u"时区类型", args=timetype.items(), required="required", **input_style),
        btforms.Textbox("ac_port", rules.is_number, description=u"AC端口", default=2000, required="required",**input_style),
        btforms.Textbox("coa_port", rules.is_number, description=u"CoA端口", default=3799, required="required",**input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加接入设备",
        action="/bas/add"
    )
开发者ID:gvsurenderreddy,项目名称:toughwlan,代码行数:16,代码来源:nas_forms.py

示例12: customer_update_form

def customer_update_form(nodes=[]):
    return btforms.Form(
        btforms.Hidden("account_number", description=u"用户账号"),
        btforms.Hidden("customer_id", description=u"mid", required="required", **input_style),
        btforms.Textbox("realname", rules.len_of(2, 32), description=u"用户姓名", required="required", **input_style),
        btforms.Textbox("customer_name", description=u"自助服务用户名", readonly="readonly", autocomplete="off", **input_style),
        btforms.Password("new_password", rules.len_of(0, 128), value="", description=u"自助服务密码(留空不修改)", **input_style),
        btforms.Textbox("email", rules.len_of(0, 128), description=u"电子邮箱", **input_style),
        btforms.Textbox("idcard", rules.len_of(0, 32), description=u"证件号码", **input_style),
        btforms.Textbox("mobile", rules.len_of(0, 32), description=u"用户手机号码", **input_style),
        btforms.Textbox("address", description=u"用户地址", hr=True, **input_style),
        btforms.Textarea("customer_desc", description=u"用户描述", rows=4, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户基本信息修改",
        action="/admin/customer/update"
    )
开发者ID:Evan-hu,项目名称:ToughRADIUS,代码行数:16,代码来源:customer_forms.py

示例13: tpl_add_form

def tpl_add_form():
    return btforms.Form(
        btforms.Textbox("tpl_name", rules.len_of(4, 64), description=u"模版名称", required="required", **input_style),
        btforms.Textarea("tpl_desc", description=u"模版描述", rows=4, **input_style),
        btforms.Button("submit", type="submit", id="submit", html=u"<b>提交</b>", **button_style),
        title=u"增加模版",
        action="/template/add"
    )
开发者ID:gvsurenderreddy,项目名称:toughwlan,代码行数:8,代码来源:template_forms.py

示例14: tpl_update_form

def tpl_update_form():
    return btforms.Form(
        btforms.Hidden("id", description=u"编号"),
        btforms.Textbox("tpl_name", rules.len_of(4, 64), description=u"模版名称", readonly="readonly", **input_style),
        btforms.Textarea("tpl_desc", description=u"模版描述", rows=4, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>更新</b>", **button_style),
        title=u"修改模版",
        action="/template/update"
    )
开发者ID:gvsurenderreddy,项目名称:toughwlan,代码行数:9,代码来源:template_forms.py

示例15: customer_open_form

def customer_open_form(nodes=[], products=[]):
    return btforms.Form(
        btforms.Dropdown("node_id", description=u"区域", args=nodes, required="required", **input_style),
        btforms.Textbox("realname", rules.len_of(2, 32), description=u"用户姓名", required="required", **input_style),
        btforms.Checkbox("is_samename", description=u"启用独立的自助服务用户名", checked=""),
        btforms.Textbox("customer_name", rules.len_of(0, 64), description=u"自助服务用户名", **input_style),
        btforms.Textbox("customer_password", rules.len_of(0, 128), description=u"自助服务用户密码", **input_style),
        btforms.Textbox("idcard", rules.len_of(1, 32), description=u"证件号码", **input_style),
        btforms.Textbox("mobile", rules.len_of(1, 32), description=u"用户手机号码", **input_style),
        btforms.Textbox("address",rules.len_of(1, 32), description=u"用户地址", hr=True, required="required", **input_style),
        btforms.Textbox("account_number", description=u"用户账号", required="required", **input_style),
        btforms.Textbox("password", description=u"认证密码", required="required", **input_style),
        btforms.Button("button", type="button", onclick="reBuildAccount();", html=u"<b>重新生成账号密码</b>", **_btn_style),
        btforms.Textbox("ip_address", description=u"用户IP地址", **input_style),
        btforms.Dropdown("product_id", args=products, description=u"资费", required="required", **input_style),
        btforms.Textbox("months", rules.is_number, description=u"月数(包月有效)", required="required", **input_style),
        btforms.Textbox("giftdays", rules.is_number, description=u"赠送天数", value=0, required="required", **input_style),
        btforms.Textbox("fee_value", rules.is_rmb, description=u"缴费金额", required="required", **input_style),
        btforms.Textbox("expire_date", rules.is_date, description=u"过期日期", readonly="readonly", **input_style),
        btforms.Hidden("status", value=1, description=u"用户状态", **input_style),
        btforms.Textarea("customer_desc", description=u"用户描述", rows=4, **input_style),
        btforms.Button("submit", type="submit", html=u"<b>提交</b>", **button_style),
        title=u"用户开户",
        action="/admin/customer/open"
    )
开发者ID:niebaopeng,项目名称:ToughRADIUS,代码行数:25,代码来源:customer_forms.py


注:本文中的toughlib.btforms.rules.len_of函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。