def delete_model(self, model_id):
        """DELETE ALL THE THINGS"""

        # 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 __HOLE__:
            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}
dataset/ETHPy150Open spiral-project/daybed/daybed/backends/couchdb/__init__.py/CouchDBBackend.delete_model