{{extend 'layout.html'}} {{try:}}{{=uplink}}{{except:}}{{pass}}

{{if request.function=='state':}} Internal state {{else:}} {{if len(request.args)>=1:}} database {{=A(request.args[0],_href=URL(r=request,f='index/'))}} {{if not request.vars.query:}}table {{=A(request.args[1],_href=URL(r=request,f='select/%s/%s'% tuple(request.args[:2])))}} {{=request.function}} {{else:}} generic select/update/delete{{pass}} {{if len(request.args)==3:}} record id {{=A(request.args[2],_href=URL(r=request,f='update/%s/%s/%s'% tuple(request.args[:3])))}} {{pass}} {{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("%s.%s"%dt,_href=URL(r=request,f='select/%s/%s'%dt))}}

[ {{=A('insert new '+dt[1],_href=URL(r=request,f='insert/%s/%s'%dt))}} ]

{{pass}} {{pass}}

{{pass}} {{if request.function=='select' and len(request.args)>1:}} [ {{=A('insert new '+request.args[1],_href=URL(r=request,f='insert/%s/%s'%tuple(request.args[:2])))}} ]

Rows in table


{{elif request.function=='select' and len(request.args)==1:}}

Rows selected


{{pass}} {{if request.function=='select' and len(request.args)>=1:}}
{{if len(request.args)==1:}} {{pass}}
SQL FILTER:
UPDATE STRING: or DELETE ALL: (sure?)
(The SQL FILTER is a condition like "table1.field1='value'". Something like "table1.field1=table2.field2" results in a SQL JOIN. Use AND, OR and (...) to build more complex filters. The UPDATE STRING is an optional expression like "field1='newvalue'". You cannot update or delete the results of a JOIN)


{{if start>0:}}[ {{=A('previous 100 records',_href=URL(r=request,f='select/%s?query=%s&start=%s'%('/'.join(request.args),query,start-100)))}} ]{{pass}} {{if nrecords==100:}}[ {{=A('next 100 records',_href=URL(r=request,f='select/%s?query=%s&start=%s'%('/'.join(request.args),query,start+100)))}} ]{{pass}} {{=records}}

Import/Export


[ export as csv file ] {{if len(request.args)==2:}} {{=FORM('or import from csv file ',INPUT(_type='file',_name='csvfile'),INPUT(_type='submit',_value='import'))}} {{pass}} {{pass}} {{if request.function=='insert' and len(request.args)>1:}}

New Record


{{=form}} {{pass}} {{if request.function=='update' and len(request.args)>2:}}

Edit current record



{{=form}} {{pass}} {{if request.function=='state':}}

Current request

{{=BEAUTIFY(request)}}

Current response

{{=BEAUTIFY(response)}}

Current session

{{=BEAUTIFY(session)}} {{pass}}