def delete(self, commit=True, *args, **kwargs): """Remove the record from the database.""" db = object_session(self) db.add(self) db.delete(self) return commit and db.commit()