To access the form values, use:
if form.process().accepted:
value = form.vars.some_field
If you will be changing the values inserted, use:
if form.process(dbio=false).accepted:
form.vars.some_field = modify(form.vars.some_field)
#but you will need to insert data into the db yourself
Happy New Year! :)
On Jan 3, 8:39 am, Adrian Edwards <[email protected]> wrote:
> to expand on this a bit, I tried to put the calculations before the
> if form.process().accepted:
>
> but I haven't been able to figure out how to access the value entered
> by the user.
> So this may just be as simple as accessing something like
> form.custom.widget.value
>
> Adrian.
>
> On Jan 2, 7:35 pm, Adrian Edwards <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hello all,
>
> > I have a page where a user enters in some data, and then some
> > calculations need to occur before the data is put into the database.
>
> > Right now I have
> > form = SQLFORM(db.entries, entry)
> > and whatever the user enters is successfully put into db.entries.
> > So now I want to do the calculations before populating the database,
> > but not sure how.
>
> > Any suggestions?
>
> > Thanks.
> > Adrian