Changes between Version 37 and Version 38 of S3/S3REST/s3_rest_controller


Ignore:
Timestamp:
10/24/10 06:36:56 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3REST/s3_rest_controller

    v37 v38  
    8282==== Validation Callbacks ====
    8383
    84 After successful submission of a create/update form (=the input data have successfully passed the field validation), you can define extra form validation methods to be invoked by using:
     84You can define extra form validation methods to be invoked after a create/update form has successfully passed the indivdual field validation, by using:
    8585
    8686{{{
     
    104104This allows you to define a common onvalidation callback for both ''create'' and ''update''.
    105105
    106 Onvalidation callbacks are meant to allow additional form data validation (beyond individual field validators). The callables receive the '''form''' as first and only parameter, while their return values will be ignored.
     106Onvalidation callbacks are meant to allow additional form data validation (beyond individual field validators). The callback functions receive the '''form''' as first and only parameter, while their return values will be ignored.
    107107
    108108Any validation errors are to be reported directly into the form as:
     
    122122==== On-accept Callbacks ====
    123123
     124You can define methods to be invoked after a record has been created/updated, by using:
     125
     126{{{
     127s3xrc.model.configure(table, create_onaccept=callback)
     128}}}
     129{{{
     130s3xrc.model.configure(table, update_onaccept=callback)
     131}}}
     132
     133where:
     134
     135  - '''table''' is the respective DB table
     136  - '''callable''' is the callback setting, see [#Callbacks Callbacks]
     137
     138If either of {{{create_onaccept}}} or {{{update_onaccept}}} is not set, then the {{{onaccept}}} setting is tried:
     139
     140{{{
     141s3xrc.model.configure(table, onaccept=callback)
     142}}}
     143
     144This allows you to define a common onaccept callback for both ''create'' and ''update''.
     145
     146The {{{onaccept}}} callbacks are meant to perform extra post-processing of the newly created/updated record (e.g. to update dependent records). The callback functions receive the respective '''record''' as first and only parameter, while their return value will be ignored.
     147
    124148==== On-Delete Callback ====
     149
     150You can define methods to be invoked after a record has been deleted, by using:
     151
     152{{{
     153s3xrc.model.configure(table, ondelete=callback)
     154}}}
     155
     156where:
     157
     158  - '''table''' is the respective DB table
     159  - '''callable''' is the callback setting, see [#Callbacks Callbacks]
     160
     161The {{{ondelete}}} callbacks are meant to perform extra post-processing of the deleted record (e.g. to update dependent records). The callback functions receive the respective '''record''' as first and only parameter, while their return value will be ignored.
     162
     163Note:
     164  At the time when the callback is invoked, the record is already deleted from the database.
     165
    125166=== Pagination ===
    126167
     
    134175response.s3.no_sspag=True
    135176}}}
     177
    136178== View Control ==
    137179