def delete_model(self, model_id):

        # Delete the associated data if any.
        records = self.delete_records(model_id)

        try:
            doc = views.model_definitions(self._db, key=model_id).rows[0].value
        except IndexError:
            raise backend_exceptions.ModelNotFound(model_id)

        # Delete the model definition if it exists.
        self._db.delete(doc)
        return {"definition": doc["definition"],
                "permissions": doc["permissions"],
                "records": records}
DELETE ALL THE THINGS
dataset/ETHPy150Open spiral-project/daybed/daybed/backends/couchdb/__init__.py/CouchDBBackend.delete_model