{{if request.function=='state':}}
Internal state
{{else:}}
{{if len(request.args)>1:}}
database {{=A(request.args[0],_href=URL(r=request,f='index/'))}}
table {{=A(request.args[1],_href=URL(r=request,f='select/%s/%s'% tuple(request.args[:2])))}}
{{if len(request.args)>2:}}
record id {{=A(request.args[2],_href=URL(r=request,f='update/%s/%s/%s'% tuple(request.args[:3])))}}
{{pass}}
{{=request.function}}
{{else:}}
Avalilable databases and tables
{{pass}}
{{pass}}
{{if request.function=='index':}}
{{if len(dbs)==0:}}No databases in this application{{pass}}
{{for dbname,items in dbs.items():}}
{{for dt in items:}}
[ {{=A('insert new records',_href=URL(r=request,f='insert/%s/%s'%dt))}} ]
{{pass}}
{{pass}}
{{pass}}
{{if request.function=='select' and len(request.args)>1:}}
[ {{=A('insert new records',_href=URL(r=request,f='insert/%s/%s'%tuple(request.args[:2])))}} ]
Rows in table
{{=FORM('SQL FILTER: ',INPUT(_type='text',_value=query,_name='query'),INPUT(_type='submit',_value='apply'))}} (A condition like "table1.field1=table2.field2" results in a SQL JOIN. Use AND, OR and (...) to build more complex filters)