Example #1
0
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)
Example #2
0
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)
Example #3
0
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()
Example #4
0
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()
Example #5
0
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()
Example #6
0
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()