Changes between Version 3 and Version 4 of IS_ONE_OF


Ignore:
Timestamp:
08/23/09 13:13:45 (15 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IS_ONE_OF

    v3 v4  
    11= IS_ONE_OF Validator =
    22
    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.
     3The '''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.
    44
    55Other 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.
     
    88
    99Usage:
    10   db.table.field.requires = IS_NULL_OR(IS_ONE_OF(db, ''"keytable.keyfield"'', ''represent'', filterby=''"fieldname"'', filter_opts=''options''))
     10  db.table.field.requires = IS_ONE_OF(db, ''"keytable.keyfield"'', ''represent'', filterby=''"fieldname"'', filter_opts=''options'')
    1111
    1212  - ''keytable'' = Name of the key table
     
    2222    - Without represent and if no 'name' field can be detected in the table, the keyfield itself will be used as option label.
    2323    - If filterby is specified, the drop-down fields get sorted by this field.
     24    - IS_ONE_OF can be cascaded through IS_NULL_OR to include empty selection
    2425
    2526Example: