本文整理汇总了Python中gluon.sqlhtml.SQLFORM.smartgrid方法的典型用法代码示例。如果您正苦于以下问题:Python SQLFORM.smartgrid方法的具体用法?Python SQLFORM.smartgrid怎么用?Python SQLFORM.smartgrid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gluon.sqlhtml.SQLFORM
的用法示例。
在下文中一共展示了SQLFORM.smartgrid方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_grid
# 需要导入模块: from gluon.sqlhtml import SQLFORM [as 别名]
# 或者: from gluon.sqlhtml.SQLFORM import smartgrid [as 别名]
def get_grid(self):
"""Return a SQLFORM.smartgrid"""
self.db.auth_user.badges.writable=True
self.db.auth_user.UM_balance.writable=True
self.db.auth_user.member_end_date.writable=True
self.db.auth_user._singular = "User"
self.db.auth_user._plural = "Users"
grid = SQLFORM.smartgrid(self.db.auth_user,
linked_tables=['badges',],
searchable= dict(parent=True, child=True),
create=False,
editable = self.auth.has_membership(role='Fab Manager'),
deletable = self.auth.has_membership(role='Fab Manager'),
showbuttontext=False,
)
return dict(grid=grid)
示例2: test_smartgrid
# 需要导入模块: from gluon.sqlhtml import SQLFORM [as 别名]
# 或者: from gluon.sqlhtml.SQLFORM import smartgrid [as 别名]
def test_smartgrid(self):
smartgrid_form = SQLFORM.smartgrid(self.db.auth_user)
self.assertEqual(smartgrid_form.xml()[:4], b'<div')
示例3: test_smartgrid
# 需要导入模块: from gluon.sqlhtml import SQLFORM [as 别名]
# 或者: from gluon.sqlhtml.SQLFORM import smartgrid [as 别名]
def test_smartgrid(self):
smartgrid_form = SQLFORM.smartgrid(self.db.auth_user)
self.assertEqual(smartgrid_form.xml(), b'<div class="web2py_grid "><div class="web2py_breadcrumbs"><ul class=""><li class="active w2p_grid_breadcrumb_elem"><a href="/a/c/f/auth_user">Auth users</a></li></ul></div><div class="web2py_console "><form action="/a/c/f/auth_user" enctype="multipart/form-data" method="GET"><input class="form-control" id="w2p_keywords" name="keywords" onfocus="jQuery('#w2p_query_fields').change();jQuery('#w2p_query_panel').slideDown();" type="text" value="" /><input class="btn btn-default" type="submit" value="Search" /><input class="btn btn-default" onclick="jQuery('#w2p_keywords').val('');" type="submit" value="Clear" /></form><div id="w2p_query_panel" style="display:none;"><select class="form-control" id="w2p_query_fields" onchange="jQuery('.w2p_query_row').hide();jQuery('#w2p_field_'+jQuery('#w2p_query_fields').val().replace('.','-')).show();" style="float:left"><option value="auth_user.id">Id</option><option value="auth_user.first_name">First name</option><option value="auth_user.last_name">Last name</option><option value="auth_user.email">E-mail</option><option value="auth_user.username">Username</option></select><div class="w2p_query_row" id="w2p_field_auth_user-id" style="display:none"><select class="form-control"><option value="=">=</option><option value="!=">!=</option><option value="<"><</option><option value=">">></option><option value="<="><=</option><option value=">=">>=</option><option value="in">in</option><option value="not in">not in</option></select><input class="id form-control" id="w2p_value_auth_user-id" type="text" /><input class="btn btn-default" onclick="w2p_build_query('new','auth_user.id')" title="Start building a new search" type="button" value="New Search" /><input class="btn btn-default" onclick="w2p_build_query('and','auth_user.id')" title="Add this to the search as an AND term" type="button" value="+ And" /><input class="btn btn-default" onclick="w2p_build_query('or','auth_user.id')" title="Add this to the search as an OR term" type="button" value="+ Or" /><input class="btn btn-default" onclick="jQuery('#w2p_query_panel').slideUp()" type="button" value="Close" /></div><div class="w2p_query_row" id="w2p_field_auth_user-first_name" style="display:none"><select class="form-control"><option value="=">=</option><option value="!=">!=</option><option value="<"><</option><option value=">">></option><option value="<="><=</option><option value=">=">>=</option><option value="starts with">starts with</option><option value="contains">contains</option><option value="in">in</option><option value="not in">not in</option></select><input class="string form-control" id="w2p_value_auth_user-first_name" type="text" /><input class="btn btn-default" onclick="w2p_build_query('new','auth_user.first_name')" title="Start building a new search" type="button" value="New Search" /><input class="btn btn-default" onclick="w2p_build_query('and','auth_user.first_name')" title="Add this to the search as an AND term" type="button" value="+ And" /><input class="btn btn-default" onclick="w2p_build_query('or','auth_user.first_name')" title="Add this to the search as an OR term" type="button" value="+ Or" /><input class="btn btn-default" onclick="jQuery('#w2p_query_panel').slideUp()" type="button" value="Close" /></div><div class="w2p_query_row" id="w2p_field_auth_user-last_name" style="display:none"><select class="form-control"><option value="=">=</option><option value="!=">!=</option><option value="<"><</option><option value=">">></option><option value="<="><=</option><option value=">=">>=</option><option value="starts with">starts with</option><option value="contains">contains</option><option value="in">in</option><option value="not in">not in</option></select><input class="string form-control" id="w2p_value_auth_user-last_name" type="text" /><input class="btn btn-default" onclick="w2p_build_query('new','auth_user.last_name')" title="Start building a new search" type="button" value="New Search" /><input class="btn btn-default" onclick="w2p_build_query('and','auth_user.last_name')" title="Add this to the search as an AND term" type="button" value="+ And" /><input class="btn btn-default" onclick="w2p_build_query('or','auth_user.last_name')" title="Add this to the search as an OR term" type="button" value="+ Or" /><input class="btn btn-default" onclick="jQuery('#w2p_query_panel').slideUp()" type="button" value="Close" /></div><div class="w2p_query_row" id="w2p_field_auth_user-email" style="display:none"><select class="form-control"><option value="=">=</option><option value="!=">!=</option><option value="<"><</option><option value=">">></option><option value="<="><=</option><option value=">=">>=</option><option value="starts with">starts with</option><option value="contains">contains</option><option value="in">in</option><option value="not in">not in</option></select><input class="string form-control" id="w2p_value_auth_user-email" type="text" /><input class="btn btn-default" onclick="w2p_build_query('new','auth_user.email')" title="Start building a new search" type="button" value="New Search" /><input class="btn btn-default" onclick="w2p_build_query('and','auth_user.email')" title="Add this to the search as an AND term" type="button" value="+ And" /><input class="btn btn-default" onclick="w2p_build_query('or','auth_user.email')" title="Add this to the search as an OR term" type="button" value="+ Or" /><input class="btn btn-default" onclick="jQuery('#w2p_query_panel').slideUp()" type="button" value="Close" /></div><div class="w2p_query_row" id="w2p_field_auth_user-username" style="display:none"><select class="form-control"><option value="=">=</option><option value="!=">!=</option><option value="<"><</option><option value=">">></option><option value="<="><=</option><option value=">=">>=</option><option value="starts with">starts with</option><option value="contains">contains</option><option value="in">in</option><option value="not in">not in</option></select><input class="string form-control" id="w2p_value_auth_user-username" type="text" /><input class="btn btn-default" onclick="w2p_build_query('new','auth_user.username')" title="Start building a new search" type="button" value="New Search" /><input class="btn btn-default" onclick="w2p_build_query('and','auth_user.username')" title="Add this to the search as an AND term" type="button" value="+ And" /><input class="btn btn-default" onclick="w2p_build_query('or','auth_user.username')" title="Add this to the search as an OR term" type="button" value="+ Or" /><input class="btn btn-default" onclick="jQuery('#w2p_query_panel').slideUp()" type="button" value="Close" /></div></div><script><!--\n\n jQuery(\'#w2p_query_fields input,#w2p_query_fields select\').css(\n \'width\',\'auto\');\n jQuery(function(){web2py_ajax_fields(\'#w2p_query_fields\');});\n function w2p_build_query(aggregator,a) {\n var b=a.replace(\'.\',\'-\');\n var option = jQuery(\'#w2p_field_\'+b+\' select\').val();\n var value;\n var $value_item = jQuery(\'#w2p_value_\'+b);\n if ($value_item.is(\':checkbox\')){\n if ($value_item.is(\':checked\'))\n value = \'True\';\n else value = \'False\';\n }\n else\n { value = $value_item.val().replace(\'"\',\'\\\\"\')}\n var s=a+\' \'+option+\' "\'+value+\'"\';\n var k=jQuery(\'#w2p_keywords\');\n var v=k.val();\n if(aggregator==\'new\') k.val(s); else k.val((v?(v+\' \'+ aggregator +\' \'):\'\')+s);\n }\n \n//--></script><div class="web2py_counter">1 records found</div></div><div class="web2py_table"><div class="web2py_htmltable" style="width:100%;overflow-x:auto;-ms-overflow-x:scroll"><table><colgroup><col data-column="1" id="auth_user-id" /><col data-column="2" id="auth_user-first_name" /><col data-column="3" id="auth_user-last_name" /><col data-column="4" id="auth_user-email" /><col data-column="5" id="auth_user-username" /><col data-column="6" /></colgroup><thead><tr class=""><th class=""><a href="/a/c/f/auth_user?keywords=&order=auth_user.id">Id</a></th><th class=""><a href="/a/c/f/auth_user?keywords=&order=auth_user.first_name">First name</a></th><th class=""><a href="/a/c/f/auth_user?keywords=&order=auth_user.last_name">Last name</a></th><th class=""><a href="/a/c/f/auth_user?keywords=&order=auth_user.email">E-mail</a></th><th class=""><a href="/a/c/f/auth_user?keywords=&order=auth_user.username">Username</a></th><th class=""></th></tr></thead><tbody><tr class="w2p_odd odd with_id" id="1"><td>1</td><td>Bart</td><td>Simpson</td><td>[email protected]</td><td>user1</td><td class="row_buttons" nowrap="nowrap"><a href="/a/c/f/auth_user/auth_membership.user_id/1"><span>Auth memberships</span></a><a href="/a/c/f/auth_user/auth_event.user_id/1"><span>Auth events</span></a><a href="/a/c/f/auth_user/auth_cas.user_id/1"><span>Auth cases</span></a><a href="/a/c/f/auth_user/t0.created_by/1"><span>T0s(created_by)</span></a><a href="/a/c/f/auth_user/t0.modified_by/1"><span>T0s(modified_by)</span></a><a href="/a/c/f/auth_user/t0_archive.created_by/1"><span>T0 archives(created_by)</span></a><a href="/a/c/f/auth_user/t0_archive.modified_by/1"><span>T0 archives(modified_by)</span></a><a class="button btn btn-default" href="/a/c/f/auth_user/view/auth_user/1"><span class="icon magnifier icon-zoom-in glyphicon glyphicon-zoom-in"></span> <span class="buttontext button" title="View">View</span></a></td></tr></tbody></table></div></div><div class="w2p_export_menu">Export:<a class="btn btn-default" href="/a/c/f/auth_user?_export_type=csv&keywords=&order=" title="Comma-separated export of visible columns. Fields from other tables are exported as they appear on-screen but this may be slow for many rows">CSV</a><a class="btn btn-default" href="/a/c/f/auth_user?_export_type=csv_with_hidden_cols&keywords=&order=" title="Comma-separated export including columns not shown; fields from other tables are exported as raw values for faster export">CSV (hidden cols)</a><a class="btn btn-default" href="/a/c/f/auth_user?_export_type=html&keywords=&order=" title="HTML export of visible columns">HTML</a><a class="btn btn-default" href="/a/c/f/auth_user?_export_type=json&keywords=&order=" title="JSON export of visible columns">JSON</a><a class="btn btn-default" href="/a/c/f/auth_user?_export_type=tsv&keywords=&order=" title="Spreadsheet-optimised export of tab-separated content, visible columns only. May be slow.">TSV (Spreadsheets)</a><a class="btn btn-default" href="/a/c/f/auth_user?_export_type=tsv_with_hidden_cols&keywords=&order=" title="Spreadsheet-optimised export of tab-separated content including hidden columns. May be slow">TSV (Spreadsheets, hidden cols)</a><a class="btn btn-default" href="/a/c/f/auth_user?_export_type=xml&keywords=&order=" title="XML export of columns shown">XML</a></div></div>')
示例4: comments_manage
# 需要导入模块: from gluon.sqlhtml import SQLFORM [as 别名]
# 或者: from gluon.sqlhtml.SQLFORM import smartgrid [as 别名]
def comments_manage():
form = SQLFORM.smartgrid(db.comment,onupdate=auth.archive)
return locals()
示例5: balises_manage
# 需要导入模块: from gluon.sqlhtml import SQLFORM [as 别名]
# 或者: from gluon.sqlhtml.SQLFORM import smartgrid [as 别名]
def balises_manage():
form = SQLFORM.smartgrid(db.balise,onupdate=auth.archive)
return locals()
示例6: error_types_manage
# 需要导入模块: from gluon.sqlhtml import SQLFORM [as 别名]
# 或者: from gluon.sqlhtml.SQLFORM import smartgrid [as 别名]
def error_types_manage():
form = SQLFORM.smartgrid(db.error_type,onupdate=auth.archive)
return locals()
示例7: subs_manage
# 需要导入模块: from gluon.sqlhtml import SQLFORM [as 别名]
# 或者: from gluon.sqlhtml.SQLFORM import smartgrid [as 别名]
def subs_manage():
form = SQLFORM.smartgrid(db.sub,onupdate=auth.archive)
return locals()
示例8: episodes_manage
# 需要导入模块: from gluon.sqlhtml import SQLFORM [as 别名]
# 或者: from gluon.sqlhtml.SQLFORM import smartgrid [as 别名]
def episodes_manage():
form = SQLFORM.smartgrid(db.episode,onupdate=auth.archive)
return locals()