UserRepository module

class repositories.user_repository.UserRepository(db_name: str = 'concord.db')

Bases: repositories.repository_interface.RepositoryInterface

A class that manipulates the user table

delete_by_id(user_id: str)bool

Deletes one Users containing the user_id

Parameters

user_id – the user’s unique identification code

Returns

A boolean representing whether the operation was successful or not

find_all_by_id(user_id: str)Tuple[List[dtos.dto_user.User], bool]

Finds all Users containing the user_id

Parameters

user_id – the user’s unique identification code

Returns

A tuple containing containing the list of users and whether the operation was successful or not

find_by_id(user_id: str)Tuple[dtos.dto_user.User, bool]

Finds one Users containing the user_id

Parameters

user_id – the user’s unique identification code

Returns

A tuple containing containing one user and whether the operation was successful or not

get_all_users()Tuple[dtos.dto_user.User, bool]

Finds all Participants containing the user_id

Returns

A tuple containing containing all users and whether the operation was successful or not

put(user: dtos.dto_user.User)bool

Puts one Users containing the user_id

Parameters

user – the user to be stored in the database

Returns

A boolean representing whether the operation was successful or not

update_by_id(user_id: str, new_data: dtos.dto_user.User)bool

Updates one Users containing the user_id

Parameters
  • user_id – the user’s unique identification code

  • new_data – the user’s new data

Returns

A boolean representing whether the operation was successful or not