def __call__(self, name, **data): r = Role.create(name, data) if not r: raise DoesNotExistsException("Cannot create role {0}" .format(name)) returner = role_show(cli_mode=self.cli_mode) return returner(name)
def __call__(self, name): r = Role.find(name) if not r: raise DoesNotExistsException( "Role {0} does not exists in database".format(name)) r.delete() if self.cli_mode: print("Role {0} deleted".format(name))
def __call__(self, **filters): if self.cli_mode: print(title("Roles:")) roles = [r.name for r in Role.filter(**filters)] if self.cli_mode: for r in roles: print(" - {0}".format(r)) return roles
def __call__(self, name): r = Role.find(name) if not r: raise DoesNotExistsException("Role {0} does not exists in database" .format(name)) r.delete() if self.cli_mode: print("Role {0} deleted".format(name))
def __call__(self, name): r = Role.find(name) if not r: raise DoesNotExistsException( "Role {0} does not exists in database".format(name)) ret = r.as_dict() if self.cli_mode: print(title(r.name + ':')) pretty_print(ret) return ret
def __call__(self, name): r = Role.find(name) if not r: raise DoesNotExistsException("Role {0} does not exists in database" .format(name)) ret = r.as_dict() if self.cli_mode: print(title(r.name + ':')) pretty_print(ret) return ret
def __call__(self, name, **data): r = Role.create(name, data) if not r: raise DoesNotExistsException("Cannot create role {0}".format(name)) returner = role_show(cli_mode=self.cli_mode) return returner(name)