RepositoryInterface module

class repositories.repository_interface.RepositoryInterface(db_name: str = 'concord.db')

Bases: object

A generic class for manipulating the database

delete_by_id(subject_id: str) → any

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(subject_id) → any

Finds all objects containing the subject_id and returns them

Parameters

subject_id – the subject identification code

Returns

any

find_by_id(subject_id: str) → any

Finds an object containing the subject_id and returns it

Parameters

subject_id – the subject identification code

Returns

any

put(subject: any) → any

Puts an object on the database

Parameters

subject – the subject to be stored on the database

Returns

any

update_by_id(subject_id: str, new_subject_data: any) → any

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