form=t2.create(db.test, onaccept=trigger)
As I understand 'onaccept' is an "after-insert" trigger. It does not
matter if I change form.vars in this trigger.
Are there any models for "before-update" and "before-insert" in T3?
(other than copying and modifiing code from T3.)
How do i pre-populate a form?
This does't work:
form=t2.create(db.test,vars={'name': 'Test'})
On Dec 1, 8:09 pm, mdipierro <[email protected]> wrote:
> you can do
>
> def myaccept(form):
> ifform.vars.email!=form.record.email:
> ... do soemthing, perhaps: db
> (db.t2_person.id==form.vars.person_id).update(....)
>
> t2.update(...,onaccept=myaccept)
>
> Massimo
>
> On Dec 1, 12:56 pm, "Wes James" <[email protected]> wrote:
>
> > I set the a student email to the t2.person email address when they
> > submit aform. Is there an easy way to update the t2.person email
> > address if the student changes the email address in their dataform?
>
> > Actually, maybe I could put the t2.person field in that spot on the
> > studentforminstead of having an email address in t2.person and
> > student tables.
>
> > Any suggestions on this?
>
> > -wj
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---