Not sure I understand the question. After
if form.accepts(...)
# here you can use form.vars.id
On Jun 2, 3:31 pm, Bill <[email protected]> wrote:
> How do I use lambda to retrieve the most recent id in conjunction with
> the guestbook code below?
>
> Would like to update my users table with a reference id to their
> guestbook entry.
>
> In order store the guestbook entry id, I need to have a reference
> id. I am not sure how to obtain this.
>
> One idea would be to grab it at login and save as a session variable.
> Please give me some insight. The reference below has given me ideas,
> but I seem to be unable to use it.
>
> form=SQLFORM(db.guestbook,fields=['url','title','location'])
> form.vars.client_ip=request.env.remote_addr
> (latitude, longitude) = geocode(form.vars.location)
> form.vars.lat=latitude
> form.vars.lon=longitude
> if form.accepts(request.vars,session):
> session.flash=' Guest Book Completed.Now YOU are on the map! '
> redirect(URL(r=request,f='index',args=
> [form.vars.filecabinet]))
> return dict(form=form)
>
> Reference:
>
> http://groups.google.com/group/web2py/browse_thread/thread/5e1f13df58...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---