The application’s model objects
Abstract base entity class.
Return a possibly HTML-decorated caption of the entity.
Parameters: |
|
---|---|
Return type: | str |
If html is None or True then the result may be an HTML representation of the entity, otherwise it is plain text.
If localized is False then the localization is turned off.
Perform any check before an new instance is inserted
Perform any check before updating the instance.
Parameters: | fields – a mapping containing fieldname -> value associations |
---|
This implementation does nothing, but subclasses can override it at will, either to adapt incoming values or to check their validity, raising an exception if something is wrong.
Delete this instance from the database.
Update entity with given data.
Parameters: |
|
---|---|
Return type: | dict |
Returns: | a mapping between field name and a tuple (oldvalue, newvalue), for each modified field |
First call check_update() to assert the validity of incoming data, then update the instance fields.
If missing_only is True then only the fields that are currently empty (that is, their value is either None or an empty string) are updated. Note that in this case an exception is made for bool fields: since in SoL they always have a value (i.e. they are never missing), they are always updated.