Changes between Version 20 and Version 21 of S3/S3ReusableField


Ignore:
Timestamp:
06/12/14 11:38:08 (7 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3ReusableField

    v20 v21  
    1010
    1111{{{#!python
    12 person_id = S3ReusableField("person_id", db.pr_person,
     12person_id = S3ReusableField("person_id", "reference pr_person",
    1313                            sortby = ["first_name", "middle_name", "last_name"],
    1414                            requires = IS_NULL_OR(IS_ONE_OF(db, "pr_person.id",
     
    1717                                                            sort=True,
    1818                                                            error_message="Person must be specified!")),
    19                             represent = lambda id: (id and \
    20                                         [person_represent(id)] or [NONE])[0],
     19                            represent = pr_person_represent,
    2120                            label = T("Person"),
    22                             comment = shn_person_id_comment,
     21                            comment = pr_person_id_comment,
    2322                            ondelete = "RESTRICT",
    2423                            widget = S3PersonAutocompleteWidget())
     
    2625
    2726This definition does '''not''' create a '''{{{Field}}}''' instance, but just holds the parameters.
    28 
    2927== Use S3ReusableFields in Table Definitions ==
    3028