Changes between Version 10 and Version 11 of IS_ONE_OF


Ignore:
Timestamp:
02/09/12 19:22:20 (10 years ago)
Author:
Fran Boon
Comment:

Update example to current code

Legend:

Unmodified
Added
Removed
Modified
  • IS_ONE_OF

    v10 v11  
    2929{{{
    3030...
    31 db.Field("pr_pe_id", db.pr_pentity),
     31db.Field("pe_id", db.pr_pentity),
    3232...
    3333
    34 db[table].pr_pe_id.requires = IS_NULL_OR(IS_ONE_OF(db,
    35     "pr_pentity.id",                          # key table=pr_pentity, key field=id
     34db[table].pe_id.requires = IS_NULL_OR(IS_ONE_OF(db,
     35    "pr_pentity.pe_id",                       # key table=pr_pentity, key field=pe_id
    3636    shn_pentity_represent,                    # function to represent a pr_pentity entry as string
    37     filterby="opt_pr_pentity_class",          # type field in the pr_pentity table
    38     filter_opts=(1,),                         # select only entries with opt_pr_pentity_class in (1,) (select only persons)
    39     orderby="pr_pentity.id"                   # NB Need explicit orderby, otherwise it orders by all fields!
     37    filterby="instance_type",                 # type field in the pr_pentity table
     38    filter_opts=("pr_person",),               # select only entries with instance_type in ("pr_person",) (select only persons)
     39    orderby="pr_pentity.pe_id"                # NB Need explicit orderby, otherwise it orders by all fields!
    4040    ))
    4141}}}