My code in controller:
***************************************************************************
************************
* def work():
*    row=db(db.autos.id==20).select() <---- can be done with DAL
*    return dict(row=row)
***************************************************************************
************************
My code in the view (new.html):
***************************************************************************
************************
* {{for r in rows:}} <-- rows not records
* {{=A(r.id,_href=URL('work', vars={'i':r.id}))}}
* {{pass}} <--- missing
***************************************************************************
************************

Anyway, your select returns at most one record.


On Mar 17, 3:55 pm, cyber <[email protected]> wrote:
> Hi there!
>
> I need a hint of how to get variable value from view to my function in
> controller.
>
> My code in controller:
> *************************************************************************** 
> ************************
> * def work():
> *    row=db.executesql('SELECT * FROM autos WHERE autos.id=20')
> *    return dict(row=row)
> *************************************************************************** 
> ************************
>
> My code in the view (new.html):
> *************************************************************************** 
> ************************
> * {{for r in records:}}
> * {{=A(r.id,_href=URL('work', vars={'i':r.id}))}}
> *************************************************************************** 
> ************************
>
> As you see I can select one row from db by id but I want work function
> to get current id instead "autos.id=20"
> I have no ideas of how to use variable from view in my controllers
> def.
>
> So, any proposals!?! Please...

Reply via email to