[web2py] Re: updating more than one record.

2012-01-31 Thread Ashraf Mansour
thanks a lot



Re: [web2py] Re: updating more than one record.

2012-01-31 Thread Bruno Rocha
in controller default.py

*def update():
> form = SQLFORM.factory(Field("category",
> requires=IS_IN_SET(["category1", "category2"]), comment="Choose a category
> to update"),
> Field("new_value",
> "double"))
>
>if form.process().accepted:
># all products on that category will be updated to the new value
> informed
>try:
>db(db.products.category ==
> form.vars.category).update(price=form.vars.new_value)
>response.flash = "All products updated!"
>except Exception:
>response.flash = "problems updating..."
> *


On Tue, Jan 31, 2012 at 7:21 PM, Ashraf Mansour wrote:

> Thank you for the immediate reply.
>
> my problem is how and where to write the statement in controller and
> views ?
>
> Regards,
>
> Ashraf
>



-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] Re: updating more than one record.

2012-01-31 Thread Ashraf Mansour
Thank you for the immediate reply.

my problem is how and where to write the statement in controller and
views ?

Regards,

Ashraf