On Tuesday, April 25, 2017 at 9:19:59 AM UTC-5, Anthony wrote:
>
> On Tuesday, April 25, 2017 at 3:20:23 AM UTC-4, Jim Russell wrote:
>>
>> I worked around this by setting the wltype field to string and adding
>> a requires=IS_IN_SET. This makes the editing page have a dropdown with the
>> set members instead of a free-form text field.
>>
>
> This is not a great idea if wltype is intended to be a reference to the
> osrwlpooltype table, as you lose the benefits of the foreign key constraint
> and the mechanisms the DAL provides for managing that.
>
> Anthony
>
Indeed, and I knew it was ugly.
I simplified my table and instead of having it reference another table, I
just set wltype to a string and then set the constraints for the field in
db.py
db.osrwhitelistpool.wltype.requires=IS_IN_SET(('ALL', 'REBOOT', 'PING))
Thanks very much for your help Anthony.
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.