def truncate(project): """ Delete all entities and relations from this project, but leave the project, schemata and attributes intact. """ from grano.logic import relations from grano.logic import entities project.updated_at = datetime.utcnow() for relation in project.relations: relations.delete(relation) for entity in project.entities: entities.delete(entity)
def delete(id): entity = object_or_404(Entity.by_id(id)) authz.require(authz.project_edit(entity.project)) entities.delete(entity) db.session.commit() raise Gone()
def delete(id): file_ = object_or_404(File.by_id(id)) authz.require(authz.project_edit(file_.project)) entities.delete(file_) db.session.commit() raise Gone()
def delete(id): entity = object_or_404(Entity.by_id(id)) authz.require(authz.entity_edit(entity)) entities.delete(entity) db.session.commit() raise Gone()