Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def index():
"""
grid.datasource = db(db.stuff.id>0) # Set
grid.datasource = db(db.stuff.id>0).select() # Rows
grid.datasource = db.stuff # Table
grid.datasource = [db.stuff,db.others] # list of Tables
grid.datasource = db(db.stuff.id==db.other.thing) # join
"""
import webgrid
grid = webgrid.WebGrid(crud)
grid.datasource = db(db.stuff.id>0)
grid.pagesize = 10
grid.enabled_rows = ['header','filter', 'pager','totals','footer','add_links']
grid.crud_function = 'data'
grid.fields = ['stuff.name','stuff.location','stuff.quantity']
grid.field_headers = ['Name','Location','Quantity']
grid.action_links = ['view','edit','delete']
grid.action_headers = ['view','edit','delete']
grid.totals = ['stuff.quantity']