<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete(self):
 """ Delete a record from the database. """

        if self._on_delete is not None:
            return self._on_delete(self)

        return self._query.delete()