Try this:

> 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()
>      if not records:
>          session.flash=T('record does not exist')
>          redirect(URL(r=request,f='select',args=[table]))
>      else: record=records[0]
>      form=SQLFORM(db[table],record,deletable=True,
>                   linkto=URL(r=request,f='select'),
>                   upload=URL(r=request,f='download'),
>                   hidden=dict(refereer=request.vars.back or 
> 'some/where/else'))
>      if form.accepts(request.vars,session):
>          response.flash=T('done!')
>          redirect(request.vars.refereer)
>      return dict(form=form)
>
>  this is the calling action in controller default.py:
>
> @t2.requires_login(next='login')
> def provvedimenti_insert():
>      id=request.args[0]
>      
> linkto=URL(r=request,c='gestione',f='update',vars=dict(refereer=request.path.info))
>      nomin=db(db.nominativi.id==id).select()
>      
> provv=db(db.provvedimenti.nominativi_id==id).select(orderby=~db.provvedimenti.data)
>      nominativi=SQLTABLE(nomin,_class='sortable',headers=headers)
>      provvedimenti=SQLTABLE(provv,linkto,_class='sortable',headers=headers)
>      return dict(nominativi=nominativi,provvedimenti=provvedimenti,id=id)

No more .../db/... in the urls.

Massimo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to