def remove_aliases(target):
    """ Remove all aliases to a destination """

    if isinstance(target, model.Entry):
        orm.delete(p for p in model.PathAlias if p.entry == target)
    elif isinstance(target, model.Category):
        orm.delete(p for p in model.PathAlias if p.category == target)
    else:
        raise TypeError("Unknown type {}".format(type(target)))
    orm.commit()
def remove_aliases ( target ) : if isinstance ( target , model . Entry ) : orm . delete ( p for p in model . PathAlias if p . entry == target ) elif isinstance ( target , model . Category ) : orm . delete ( p for p in model . PathAlias if p . category == target ) else : raise TypeError ( "Unknown type {}" . format ( type ( target ) ) ) orm . commit ( )
Remove all aliases to a destination