Welcome | Get started | Dive into Lino | Contribute | Topics | Reference | More

Customize how data is updated

There are many ways to customize how to update rows in the database.

class lino.core.model.Model
before_ui_save(self, ar, cw)

A hook for adding custom code to be executed each time an instance of this model gets updated via the user interface and before the changes are written to the database.

Consider using the pre_ui_save signal instead.

Example in lino_xl.lib.cal.Event to mark the event as user modified by setting a default state.

after_ui_save(self, ar, cw)

Like before_ui_save(), but is called after the changes are written to the database.

Arguments:

ar: the action request.

cw: the ChangeWatcher object, or None if this is a new instance.

Called after a PUT or POST on this row, and after the row has been saved.

Used by lino_welfare.modlib.debts.models.Budget to fill default entries to a new Budget, or by lino_welfare.modlib.cbss.models.CBSSRequest to execute the request, or by lino_welfare.modlib.jobs.models.Contract, lino_welfare.modlib.pcsw.models.Coaching or lino.modlib.vat.models.Vat. Or lino_welfare.modlib.households.models.Household overrides this in order to call its populate method.

update_owned_instance(self, controllable)

Called by lino.modlib.gfks.Controllable.

after_update_owned_instance(self, controllable)

Called by lino.modlib.gfks.Controllable.

class lino.core.actors.Actor