예제 #1
0
파일: stream.py 프로젝트: ljxia/shiftserver
def delete(id):
    """
    Delete a stream. Deletes all permission documents associated with the stream
    as well.
    Parameters:
        id - a stream id.
    """
    db = core.connect()
    permIds = [perm["_id"] for perm in permission.permissionsForStream(id)]
    [permission.delete(permId) for permId in permIds]
    del db[id]
예제 #2
0
def deleteAllPermissions():
    permIds = [aperm["_id"] for aperm in core.query(schema.allPermissions)]
    [permission.delete(permId) for permId in permIds]
예제 #3
0
def deleteAllShifts():
    shiftIds = [ashift["_id"] for ashift in core.query(schema.allShifts)]
    [permission.delete(shiftId) for shiftId in shiftIds]