WordsRepository module

class repositories.words_repository.WordsRepository(db_name: str = 'concord.db')

Bases: repositories.repository_interface.RepositoryInterface

delete_by_id(words_id: str)bool

Deletes an object containing the subject_id and returns whether the operation was successful or not

Parameters

subject_id – the subject identification code

Returns

any

find_all_by_id(words_id: str)Tuple[List[dtos.dto_words.Words], bool]

Finds all objects containing the subject_id and returns them

Parameters

subject_id – the subject identification code

Returns

any

find_by_id(words_id: str)Tuple[dtos.dto_words.Words, bool]

Finds an object containing the subject_id and returns it

Parameters

subject_id – the subject identification code

Returns

any

put(words: dtos.dto_words.Words)bool

Puts an object on the database

Parameters

subject – the subject to be stored on the database

Returns

any

update_by_id(words_id: str, new_data: dtos.dto_words.Words)bool

Updates an object containing the subject_id and returns it

Parameters
  • subject_id – the subject identification code

  • new_subject_data – the new subject data

Returns

any