Changes between Version 4 and Version 5 of IS_ONE_OF_EMPTY
- Timestamp:
- 06/17/10 20:51:55 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IS_ONE_OF_EMPTY
v4 v5 18 18 Keep in mind that the corresponding model assumes ''default validator'' against the organisation_id. 19 19 20 The working example is [http://bazaar.launchpad.net/~flavour/sahana /sahanapy-trunk/annotate/569/controllers/or.py controllers/or.py]:[[BR]]20 The working example is [http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/annotate/569/controllers/or.py controllers/or.py]: 21 21 22 22 here the organisation_id is not mandatory, but: if present, must be validated against the (large) organisation table. … … 26 26 27 27 # the update forms are not ready. when they will - uncomment this and comment the next one 28 #if request.args(0) in ( 'create','update'):29 if request.args(0) == 'create':30 db[table].organisation_id.requires = IS_NULL_OR(IS_ONE_OF_EMPTY(db, 'or_organisation.id'))28 #if request.args(0) in ("create", "update"): 29 if request.args(0) == "create": 30 db[table].organisation_id.requires = IS_NULL_OR(IS_ONE_OF_EMPTY(db, "or_organisation.id")) 31 31 32 32 ... … … 38 38 Once it is ready, the line 39 39 {{{ 40 if request.args(0) in ( 'create','update'):40 if request.args(0) in ("create", "update"): 41 41 }}} 42 42 will replace the existing one, taking care of just ''create'': 43 43 44 44 {{{ 45 if request.args(0) == 'create':45 if request.args(0) == "create": 46 46 }}} 47 47 … … 49 49 '''2. View - Auto-complete''' 50 50 51 And the complimentary view [http://bazaar.launchpad.net/~flavour/sahana /sahanapy-trunk/annotate/569/views/or/office_create.html or/office_create.html]51 And the complimentary view [http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/annotate/569/views/or/office_create.html or/office_create.html] 52 52 53 53 {{{