本文整理匯總了Python中gluon.globals.Session.frm_filter方法的典型用法代碼示例。如果您正苦於以下問題:Python Session.frm_filter方法的具體用法?Python Session.frm_filter怎麽用?Python Session.frm_filter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gluon.globals.Session
的用法示例。
在下文中一共展示了Session.frm_filter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: str
# 需要導入模塊: from gluon.globals import Session [as 別名]
# 或者: from gluon.globals.Session import frm_filter [as 別名]
response.flash = load
if session.frm_filter:
frm_filter.vars = session.frm_filter
else:
response.flash = str(ns.error_message)
flash=response.flash
frm_filter.process(keepvalues=True,onfailure=None)
frm_filter.errors.clear()
response.flash = flash
frm_filter.custom.submit = ui.control.get_mobil_button(label=T("Search"), href="#",
cformat=None, style="text-align: left;", icon="search", ajax="false", theme="a",
onclick= "document.forms['frm_filter'].submit();", cmd_id="filter_submit")
frm_filter.custom.widget.repname["_onkeydown"]="if (event.keyCode == 13) document.getElementById('filter_submit').click()"
if not request.post_vars.has_key("ins_cmd"):
session.frm_filter = frm_filter.vars
dbs_reports=None
if frm_filter.vars.database and frm_filter.vars.database!="":
if ns.local.setEngine(database=db.databases(id=frm_filter.vars.database).alias, check_ndi=False, created=False, createdb=False):
query = (ns.db.ui_report.id>0)
dbs_reports = []
if frm_filter.vars.repname and frm_filter.vars.repname!="":
query = query & ((ns.db.ui_report.repname.lower().like("%"+str(request.post_vars.repname).lower()+"%"))|
(ns.db.ui_report.description.lower().like("%"+str(request.post_vars.repname).lower()+"%")))
if frm_filter.vars.label and frm_filter.vars.label!="":
groups_id=ns.valid.get_groups_id('nervatype', frm_filter.vars.label)
if groups_id:
query = query & ((ns.db.ui_report.nervatype==groups_id))
else:
query = query & ((ns.db.ui_report.transtype==ns.valid.get_groups_id('transtype', frm_filter.vars.label)))