[web2py] Re: Using writable=False fields in an onupdate function

2016-03-11 Thread Anthony
On Friday, March 11, 2016 at 2:36:14 PM UTC-5, David Orme wrote: > > That is exactly what I was looking for. I don't know how it compares for > performance with the record id query, but it makes for very clean code, and > the fact that it exposes the reference table fields is very neat. > Your s

[web2py] Re: Using writable=False fields in an onupdate function

2016-03-11 Thread David Orme
That is exactly what I was looking for. I don't know how it compares for performance with the record id query, but it makes for very clean code, and the fact that it exposes the reference table fields is very neat. Many thanks! -- Resources: - http://web2py.com - http://web2py.com/book (Docume

[web2py] Re: Using writable=False fields in an onupdate function

2016-03-11 Thread Anthony
If you are updating a record, you should be able to retrieve the full record via form.record: def update_administer_volunteers(form): # Email the decision to the proposer volunteer = form.record.volunteer_id # alternatives if form.vars.admin_status == 'Approved': mai

Re: [web2py] Re: Using writable=False fields in an onupdate function

2016-03-11 Thread Richard Vézina
SQLFORM and SQLFORM.gris play well with each other you just have to leve the create/read/update to SQLFORM and use .grid for the display... Did you try session? Richard On Fri, Mar 11, 2016 at 5:30 AM, David Orme wrote: > Hello all, > > Thanks for the information and help. > > - I can see that

[web2py] Re: Using writable=False fields in an onupdate function

2016-03-11 Thread David Orme
Hello all, Thanks for the information and help. - I can see that using SQLFORM simplifies it, but the SQLFORM.grid API makes it really easy to present a user with a summary table of options that they can then click into to see details. - The other options suggested both carry out the query I w

Re: [web2py] Re: Using writable=False fields in an onupdate function

2016-03-10 Thread Richard Vézina
If you use session be aware that the value you put in session will remain there for the duration of the session, so you need to carefully reset them or init them in order to not create bug... As Dave S mention SQLFORM() wouldn't maybe suffer from this issue as you can do that : form = SQLFORM(...

Re: [web2py] Re: Using writable=False fields in an onupdate function

2016-03-10 Thread Richard Vézina
Ok, your form is not over auth_user... Sorry fast reading does that... You can use session then... session.volunteer_id = db.table(row_id).volunteer_id Or You can passe it as request vars : URL(..., vars=dict(volunteer_id=db.table(row_id).volunteer_id)) Though, I am not sure you will be able

[web2py] Re: Using writable=False fields in an onupdate function

2016-03-10 Thread Dave S
On Thursday, March 10, 2016 at 12:01:47 PM UTC-8, David Orme wrote: > > That's the problem - the auth_user row _can't_ be retrieved because > form.vars.volunteer_id is None. > Is this one of the places you should set it in your controller before calling form.process()? In regular SQLFORM, tha

[web2py] Re: Using writable=False fields in an onupdate function

2016-03-10 Thread David Orme
That's the problem - the auth_user row _can't_ be retrieved because form.vars.volunteer_id is None. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You r