Changes between Version 31 and Version 32 of S3/S3REST/s3_rest_controller
- Timestamp:
- 10/24/10 06:08:23 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3REST/s3_rest_controller
v31 v32 100 100 This allows you to define a common onvalidation callback for both ''create'' and ''update''. 101 101 102 Onvalidation callbacks are meant to allow form data validation, where any validation errors are to be put directly into the form as:102 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. 103 103 104 Any validation errors are to be reported directly into the form as: 104 105 {{{ 105 106 form.errors[fieldname] = error_msg … … 111 112 - '''error_msg''' is the error message to be displayed in the form close to that field 112 113 113 The callables receive the form as first and only parameter, and their return values will be ignored.114 If after the execution of the onvalidation callback any messages are found in {{{form.errors}}}, then no data are being imported and instead, the process will return to the input view with the messages displayed close to the respective form fields. 114 115 115 116 '''Important:''' 116 On-validation callbacks are also invoked in non-interactive data imports, where multiple records are being processed in one and the same request. Therefore the callback '''must not redirect'''! 117 117 In non-interactive data imports, the error message will be added to the import tree as extra attribute of the invalid element. The XML importer will however process all records in the import tree in order to find all validation errors before reporting the invalid tree to the sender, and in case {{{ignore_errors}}} is used, all valid records will be imported in the first attempt. Therefore the callback '''must not redirect'''! 118 118 ==== On-accept Callbacks ==== 119 119