Users
this service has no specific implementations other than the default mixins.
Class UsersService
class UsersService(CommonMixin, NameMixin, PrintMixin)
disable
def disable(user_id: int) -> None
disable user
add_group
def add_group(user_id: int, group_id: int) -> None
add user to group
remove_group
def remove_group(user_id: int, group_id: int) -> None
remove user from group
Class CommonMixin
class CommonMixin()
Mixin with common methods for services.
get
def get(id: int) -> Dict
Fetch one by ID
get_all
def get_all() -> List[Dict]
fetch all objects.
update
def update(id: int, data: Dict) -> Dict
Update by ID
create
def create(data: Dict) -> Dict
Create a new object with data
delete
def delete(id: int) -> None
Delete by ID
Class NameMixin
class NameMixin()
Mixin for nameable services (by name or slug).
exists
def exists(name_or_slug: str) -> bool
Check if an object with given name_or_slug
exists
get_by_name
def get_by_name(name_or_slug: str) -> Optional[Dict]
Get by name or slug
get_id
def get_id(name_or_slug: str) -> Optional[int]
Get the ID for an object by name or slug, returns None if not found
Class PrintMixin
class PrintMixin()
Mixin class for printing data