crud.update(table, record, next, onvalidation, onaccept, ondelete, log, message, deletable) |
DAL table or a tablename the method should act on
next is the URL to redirect to after success. If the URL contains the substring "[id]" this will be replaced by the id of the record currently created/updated.
deletable determines whether the "update" form should have a delete option.
The onvalidation argument can be None or can be a function that takes the form and returns nothing. Such a function would be called and passed the form, immediately after validation (if validation passes) and before anything else happens. This function has multiple purposes: for example, to perform additional checks on the form and eventually add errors to the form, or to compute the values of some fields based on the values of other fields, or to trigger some action before a record is created/updated.
onaccept is a function to be called after the form submission is accepted and acted upon, but before redirection.
log is the log message. Log messages in CRUD see variables in the form.vars dictionary such as "%(id)s".
message is the flash message upon form acceptance.
record and record_id are the id of the record the method should act on.