Web3py FORM referenced fields

72 views
Skip to first unread message

John Bannister

unread,
Jun 12, 2019, 7:02:18 AM6/12/19
to web2py-users
Hi All,

Does anyone have a working example of web3py Form using referenced fields?

I have created the standard person / pets tables with pets referencing person as 'reference person' in the table definition.

Using form=Form(db.pet) I get the dropdown of persons for the add no worries but on the form=Form(db.pet, record=id) for the edit form .. neither the id of the person or the persons name (format='%(name)s' is displayed even though I can still select from the dropdown list. The id is definately stored in the db.

BR
John




Massimo Di Pierro

unread,
Jun 12, 2019, 12:58:42 PM6/12/19
to web2py-users
thanks for reporting this. please open a web3py ticket and will look into this shortly.

Massimo Di Pierro

unread,
Jun 12, 2019, 11:09:16 PM6/12/19
to web2py-users
I added an example that works for me.
Maybe can help you debug the problem:


On Wednesday, 12 June 2019 04:02:18 UTC-7, John Bannister wrote:

John Bannister

unread,
Jun 13, 2019, 2:25:26 AM6/13/19
to web...@googlegroups.com

Hi Massimo,

 

Issue is not the dropdown for referenced fields on an Add rec as  that works fine. Issue is when you want to edit a record with a referenced field so

 

form=Form(db.order, record=id)

 

Referenced field is blank (although dropdown is available). All other fields are populated with db values.

 

BR

John

--
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 received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/d40dcdf9-96c9-43a3-a9ab-d1c3090c7ed1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Massimo Di Pierro

unread,
Jun 14, 2019, 10:37:38 AM6/14/19
to web2py-users
Thanks. That clarifies. Will fix later today.

To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages