def set_database(self, db):
<EOL>from .database import Database<EOL>assert isinstance(db, Database), "<STR_LIT>"<EOL>self._database = db<EOL>
Sets the `Database` that this model instance belongs to.
This is done automatically when the instance is read from the database or written to it.