so, which is the correct way to pass args=[tablename] in order to make work correctly: if len(request.args)==2 and request.args[0] in db.tables: table=request.args[0]
Paolo On 5 Dic, 22:24, mdipierro <[EMAIL PROTECTED]> wrote: > > def provvedimenti_insert(): > > id=request.args[1] > > > > linkto=URL(r=request,c='gestione',f='update',vars=dict(refereer=request.env.path_info)) > > the line above is not passing any args=[tablename] and > > > and in the function update, the line that begins with if len > > (request.args)<2 ... is line 230: > > > def update(): > > if len(request.args)<2 or not request.args[0] in db.tables: > > table=request.args[0] > > else: > > id=int(request.args[1]) > > records=db(db[table].id==request.args[1]).select() > > should probably be something like: > > > def update(): > > if len(request.args)==2 and request.args[0] in db.tables: > > table=request.args[0] > > id=int(request.args[1]) > > records=db(db[table].id==request.args[1]).select() > > else: records=None > > else it fails when request.args=[] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---