Models - BaseModel
Description
This class is derived from buzhug.Base and is used as a super-class for all SaWALi models that require persistent data storage.
Properties
- basename (String)
- Database directory name.
- basepath (String)
- Absolute path of the database directory.
- calltime (Float)
- Current time in seconds, time.time().
Methods
- __init__ (basename="", prefix="")
- Sets the `basename` and `basepath` properties, instantiates buzhug.Base, and creates the database schema if the model is used for the first time.
- _create_schema
- A helper invoked by __init__ to create the database schema. This method is overridden per sub-class.
- remove (record_id)
- Override of Base.remove. Deletes a database record and removes old record versions (Base.cleanup).
- reset
- Destroys the database and all records within it, then recreates the database schema.
- update (record, kargs**)
- Override of Base.update. Updates a specific database record's properties following kargs**, then removes old record versions (Base.cleanup).