Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
Customize how data is created¶
There are many ways to customize how to insert rows into the database.
- class lino.core.model.Model
- on_create(self)¶
Override this to set default values that depend on the request.
The difference with Django’s pre_init and post_init signals is that (1) you override the method instead of binding a signal and (2) you get the action request as argument.
Used e.g. by
lino_xl.lib.notes.Note
.
- after_ui_create(self, ar)¶
Hook to define custom behaviour to run when a user has created a new instance of this model.
- submit_insert¶
The
SubmitInsert
action to be executed when the when the users submits an insert window.See
lino.mixins.dupable
for an example of how to override it.
- create_from_choice(cls, text)¶
Called when a learning combo has been submitted. Create a persistent database object if the given text contains enough information.
- choice_text_to_dict(cls, text)¶
Return a dict of the fields to fill when the given text contains enough information for creating a new database object.
- class lino.core.actors.Actor
- allow_create = True
If this is False, the table won’t have any insert_action.
- get_create_permission(self, ar)¶
Dynamic test per request.
This is being called only when
allow_create
is True.