By default, form.process() does an insert of the submitted record. If you 
don't want that, you can do:

if form.process(..., dbio=False).accepted:

or

if form.validate(...):

The only difference between process() and validate() is that dbio=True by 
default in process(), and process() returns the form itself rather than the 
True/False result of the validation.

Is there a reason you're not using an update form, though?

Anthony

On Friday, June 8, 2012 11:18:50 AM UTC-4, Relsi Hur wrote:
>
> Hello,
>
> I have a html form, and a action like this:
>
> def edit_my_table():
>     form = SQLFORM(db.my_table)
>     if form.process(session=None, formname='edit_').accepted:
>         db(db.my_table.id == request.args[0]).update(my_field = 
> request.post_vars.my_value)
>         response.flash = 'OK'
>     elif form.errors:
>         response.flash = 'NOK'
>
> Well, it is updating 'my_field' in 'my_db' correctly, but it is creating 
> a new item too, with the same value of the update.
>
> Database is sqlite.
>
> What am I doing wrong?
>
>
>

Reply via email to