Changes between Version 1 and Version 2 of IS_ONE_OF_EMPTY
- Timestamp:
- 02/03/10 19:11:14 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IS_ONE_OF_EMPTY
v1 v2 11 11 '''How to use the IS_ONE_OF_EMPTY?''' 12 12 13 ''' In controller.'''13 '''1. Controller''' 14 14 15 15 16 16 Keep in mind that the corresponding model assumes ''default validator'' against the organisation_id. 17 17 18 The working example is [http://bazaar.launchpad.net/~flavour/sahana/sahanapy-trunk/annotate/569/controllers/or.py controllers/or.py]:[[BR]] 18 19 19 here the organisation_id is not mandatory, but if present, must be validated against the (large) organisation table.20 here the organisation_id is not mandatory, but: if present, must be validated against the (large) organisation table. 20 21 {{{ 21 22 def office(): … … 30 31 }}} 31 32 32 '''Autocomplete - in the view.''' 33 34 '''Note:''' the method ''update'' has a separate view file, and as of now it is not having the auto-complete functionality yet. 35 36 Once it is ready, the line 37 {{{ 38 if request.args(0) in ('create','update'): 39 }}} 40 will replace the existing one, taking care of just ''create'': 41 42 {{{ 43 if request.args(0) == 'create': 44 }}} 45 46 47 '''2. View - Auto-complete''' 33 48 34 49 And the complimentary view [http://bazaar.launchpad.net/~flavour/sahana/sahanapy-trunk/annotate/569/views/or/office_create.html or/office_create.html]