Suggestion to add in documantation about reference fields

20 views
Skip to first unread message

Tom Clerckx

unread,
May 24, 2017, 6:28:18 AM5/24/17
to web2py-users
The web2py documentation indicates that a reference field has the following default validator:
IS_IN_DB(db, table.field, format)

I suggest the default validator to be described as:
IS_IN_DB(db, table._id, table._format)

If you use any other field besides table._id in the validator, this causes errors when trying to insert a new row (e.g. via the admin interface)
Maybe it is worth indicating that when -for whatever reason- you want to change the validator, you must refer back to the id and not to another field of the referring table?

Or am I wrong in this reasoning?
Reply all
Reply to author
Forward
0 new messages