my_application.repositories package¶
Submodules¶
my_application.repositories.BaselineToMongo module¶
my_application.repositories.CompetitionRepository module¶
-
class
my_application.repositories.CompetitionRepository.
BaseRepository
(host, dbname)[source]¶ Bases:
object
Repository base class. Implements the methods to write or delete rows in the table.
insert_one(): inserts one row in the table
insert_many(): insets multiple rows in the table
delete_one(): deletes one row from the table
-
instance
= None¶
-
-
class
my_application.repositories.CompetitionRepository.
Competition
(competition_id, name, datastream_id, initial_batch_size, initial_training_time, batch_size, time_interval, start_date, end_date, target_class, file_path, predictions_time_interval, description, code)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
batch_size
¶
-
code
¶
-
competition_id
¶
-
datastream
¶
-
datastream_id
¶
-
description
¶
-
end_date
¶
-
file_path
¶
-
initial_batch_size
¶
-
initial_training_time
¶
-
name
¶
-
predictions_time_interval
¶
-
start_date
¶
-
target_class
¶
-
time_interval
¶
-
-
class
my_application.repositories.CompetitionRepository.
CompetitionRepository
(host, dbname)[source]¶ Bases:
my_application.repositories.CompetitionRepository.BaseRepository
Competition repository class.
Implements the methods to retrieve competitions by different condititons.
get_competition_by_id(): Retrieve competition by its ID
set_competition_code(): Update the competition code
get_all_competitions(): Retrieve all competition
get_competition_by_code(): Retrieve the competition by code
get_competitions_by_user(): Retrieve competition for a given user
-
class
my_application.repositories.CompetitionRepository.
Datastream
(datastream_id, name, description, file_path)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
competitions
¶
-
datastream_id
¶
-
description
¶
-
file_path
¶
-
name
¶
-
-
class
my_application.repositories.CompetitionRepository.
DatastreamRepository
(host, dbname)[source]¶ Bases:
my_application.repositories.CompetitionRepository.BaseRepository
Competition repository class.
Implements the methods to retrieve competitions by different condititons.
get_competition_by_id(): Retrieve competition by its ID
set_competition_code(): Update the competition code
get_all_competitions(): Retrieve all competition
get_competition_by_code(): Retrieve the competition by code
get_competitions_by_user(): Retrieve competition for a given user
-
class
my_application.repositories.CompetitionRepository.
Subscription
(subscription_id, competition_id, user_id)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
competition
¶
-
competition_id
¶
-
subscription_id
¶
-
time_create
¶
-
user
¶
-
user_id
¶
-
-
class
my_application.repositories.CompetitionRepository.
SubscriptionRepository
(host, dbname)[source]¶ Bases:
my_application.repositories.CompetitionRepository.BaseRepository
Subscription repository class.
Implements the methods to retrieve subscriptions by different condititons.
get_competition_subscribers(): Get users that subscribed to the competition
check_subscription(): Check if a given user is subscribed to a given competition
get_subscription(): Retrieve the subscription for a user
-
class
my_application.repositories.CompetitionRepository.
User
(user_id, first_name, last_name, email, password, role, confirmed, confirmed_on)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
-
confirmed
¶
-
confirmed_on
¶
-
email
¶
-
first_name
¶
-
last_name
¶
-
password_hash
¶
-
role
¶
-
user_id
¶
-
-
class
my_application.repositories.CompetitionRepository.
UserRepository
(host, dbname)[source]¶ Bases:
my_application.repositories.CompetitionRepository.BaseRepository
User repository class.
Implements the methods to query the USERS table.
get_user_by_id(): Retrieve user information based on his ID
get_user_by_email(): Retrieve user information based on his email
get_all_users(): List all users
delete_many(): Delete several users at the same time
confirm_user(): Manually confirm user’s registration