Changes between Version 1 and Version 2 of IS_ONE_OF
- Timestamp:
- 08/23/09 12:58:57 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IS_ONE_OF
v1 v2 1 1 = IS_ONE_OF Validator = 2 2 3 The IS_ONE_OF() validator is a custom version of web2py's IS_IN_DB() for foreign key lookups in a key table. Other than IS_IN_DB, the IS_ONE_OF validator is deletion status sensitive, i.e. records in the key table that are flagged as 'deleted' will be ignored.3 The IS_ONE_OF() validator is a custom version of web2py's IS_IN_DB() for foreign key lookups in a key table. In forms, the respective field will be rendered as a drop-down field. 4 4 5 Furthermore, it is possible to filter the key records by a type field (which should be int) for certain options 5 Other than IS_IN_DB, the IS_ONE_OF validator is deletion status sensitive, i.e. records in the key table that are flagged as 'deleted' will be ignored. Furthermore, it is possible to filter the key records by a type field (which should be int) for certain options. 6 6 7 7 Usage: … … 17 17 - filter_opts=''"options"'' = a list or tuple of allowed values for the filterby-field 18 18 19 If filterby is specified, the drop-down fields get sorted by this field. 19 Note: 20 - Without represent and if no 'name' field can be detected in the table, the keyfield itself will be used as option label. 21 - If filterby is specified, the drop-down fields get sorted by this field. 20 22 21 23 Example: