Changes between Version 74 and Version 75 of S3/S3REST/s3_rest_controller


Ignore:
Timestamp:
10/15/12 13:15:17 (9 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3REST/s3_rest_controller

    v74 v75  
    232232The {{{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 {{{FORM}}} instance (with the input data being in {{{form.vars}}}) as first and only parameter, while their return value will be ignored.
    233233
    234 ==== On-Delete Callback ====
    235 
    236 You can define methods to be invoked after a record has been deleted, by using:
    237 
    238 {{{
    239 s3db.configure(tablename, ondelete=callback)
     234==== On-Delete-Cascade Callback ====
     235
     236You can specify callbacks to be invoked when a record is to be deleted:
     237
     238{{{
     239s3db.configure(tablename, ondelete_cascade=callback)
    240240}}}
    241241
     
    245245  - '''callable''' is the callback setting, see [#Callbacks Callbacks]
    246246
    247 The {{{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.
    248 
    249 Note:
    250   At the time when the callback is invoked, the record is already deleted from the database.
     247The {{{ondelete_cascade}}} callback is to perform cascade actions before deleting a record (e.g. to update or remove dependend records, or to release constraints that cannot be introspected). The hook will receive the ''record'' as its only parameter (note that it will only contain the record ID), its return value will be ignored.
     248
     249  '''Note:''' the ''record'' will only contain the record ID but no details
     250
     251==== On-Delete Callback ====
     252
     253You can also define callbacks to be invoked ''after'' a record has been deleted:
     254
     255{{{
     256s3db.configure(tablename, ondelete=callback)
     257}}}
     258
     259where:
     260
     261  - '''table''' is the respective DB table
     262  - '''callable''' is the callback setting, see [#Callbacks Callbacks]
     263
     264The {{{ondelete}}} callbacks are meant to perform extra post-processing of the deleted record (e.g. updates to counters or other aggregates). The callback function will receive the respective ''record'' as its only parameter, while its return value will be ignored.
     265
     266  '''Note:''' at the time when the callback is invoked, the record is already deleted from the database.
     267  '''Note:''' the ''record'' will only contain the record ID but no details
    251268
    252269=== Pagination ===