Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | 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_savesignal instead.Example in
lino_xl.lib.cal.Eventto 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: theChangeWatcherobject, 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.Budgetto fill default entries to a new Budget, or bylino_welfare.modlib.cbss.models.CBSSRequestto execute the request, or bylino_welfare.modlib.jobs.models.Contract,lino_welfare.modlib.pcsw.models.Coachingorlino.modlib.vat.models.Vat. Orlino_welfare.modlib.households.models.Householdoverrides 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