The code in controller is:

@auth.requires_login()
def new():

form = SQLFORM(db.autos, fields=['num'], labels={'num':'Number'},
submit_button='GO', formstyle='divs')
    if form.accepts(request.vars, session):
        response.flash = 'Yoh-ho-ho!'
    elif form.errors:
        response.flash = 'Bad-bad-bad!'
    else:
        response.flash = 'Fill the form'
    rows=db(db.autos.id>0).select()
    last_row=rows[-1]
    last_row.update_record(name=author)
    return dict(form=form)


On 9 мар, 17:27, DenesL <denes1...@yahoo.ca> wrote:
> Can you show us your current code?.
>
> On Mar 9, 9:03 am, cyber <vlad.mul...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi
>
> > How can I update new (just created) record in the table?
> > Table consists of several fields but in the form page user have to
> > enter only one value for one row.
> > So, I need insert in the current row not only this value but user name
> > and datetime.
> > I can insert first value but I have no idea of how to auto update new
> > row with required values.
>
> > Any ideas?

Reply via email to