6. Controller

##### Copy the code below and paste into default.py #####

@auth.requires_membership('manager')
def manage_aliases():
    response.title = T("Manage Aliases")
    grid = SQLFORM.grid(db.the_aliaser,
                        fields=(db.the_aliaser.name, db.the_aliaser.alias_url),
                        maxtextlengths= {'the_aliaser.alias_url' : 200})

    return locals()
  • More on SQLFORM.grid()
  • More on function decorators

[ Previous ] [ Next ]