bundesliga_tippspiel.db.user_generated package

Submodules

bundesliga_tippspiel.db.user_generated.Bet module

class bundesliga_tippspiel.db.user_generated.Bet.Bet(*args, **kwargs)

Bases: jerrycan.db.ModelMixin.ModelMixin, sqlalchemy.orm.decl_api.Model

Model that describes the ‘bets’ SQL table

MAX_POINTS: int = 15
POSSIBLE_POINTS: List[int] = [0, 3, 7, 10, 12, 15]
__init__(*args, **kwargs)

Initializes the Model :param args: The constructor arguments :param kwargs: The constructor keyword arguments

away_score: int
away_team_abbreviation: str
evaluate() Optional[int]

Evaluates the current points score on this bet :return: The calculated points (or None if the math hasn’t started yet)

home_score: int
home_team_abbreviation: str
league: str
match: bundesliga_tippspiel.db.match_data.Match.Match
matchday: int
points: int
season: int
user: jerrycan.db.User.User
user_id: int

bundesliga_tippspiel.db.user_generated.ChatMessage module

class bundesliga_tippspiel.db.user_generated.ChatMessage.ChatMessage(*args, **kwargs)

Bases: jerrycan.db.ModelMixin.ModelMixin, sqlalchemy.orm.decl_api.Model

Model that describes the ‘chat_messages’ SQL table

__init__(*args, **kwargs)

Initializes the Model :param args: The constructor arguments :param kwargs: The constructor keyword arguments

children: List[bundesliga_tippspiel.db.user_generated.ChatMessage.ChatMessage]
creation_time: float
delete()

Marks the message as deleted :return: None

deleted: bool
edit(new_text: str)

Edits the message :param new_text: The new message text :return: None

edited: bool
get_text() Optional[str]
Returns

The text of the chat message if the user still exists and the message has not been deleted

id: int
last_edit: float
parent: bundesliga_tippspiel.db.user_generated.ChatMessage.ChatMessage
parent_id: int
text: str
user: Optional[jerrycan.db.User.User]
user_id: int

bundesliga_tippspiel.db.user_generated.LeaderboardEntry module

class bundesliga_tippspiel.db.user_generated.LeaderboardEntry.LeaderboardEntry(*args, **kwargs)

Bases: jerrycan.db.ModelMixin.ModelMixin, sqlalchemy.orm.decl_api.Model

Model that describes the ‘leaderboard_entries’ SQL table

__init__(*args, **kwargs)

Initializes the Model :param args: The constructor arguments :param kwargs: The constructor keyword arguments

get_position_info(include_bots: bool) Tuple[int, int]

Retrieves position info :param include_bots: Whether or not to include bots in the ranking :return: Current Position, Previous Position

get_tendency(include_bots: bool) str

Calculates the position tendency :param include_bots: Whether or not to include bots :return: The tendency as a string (example ‘+2’)

get_tendency_class(include_bots: bool) str

Calculates the tendency and returns the corrsponding CSS class :param include_bots: Whether or not to include bots :return: The tendency CSS class name

league: int
classmethod load_history(league: str, season: int, matchday: int) List[Tuple[jerrycan.db.User.User, List[bundesliga_tippspiel.db.user_generated.LeaderboardEntry.LeaderboardEntry]]]

Loads the history for the previous matches in a season for each user :param league: The league for which to retrieve the history :param season: The season for which to retrieve the history :param matchday: The matchday for which to retrieve the history :return: The history as a list of tuples of users and a list of

the corresponding LeaderboardEntry objects. Sorted by current position

matchday: int
no_bot_position: int
no_bot_previous_position: int
points: int
position: int
previous_position: int
season: int
user: jerrycan.db.User.User
user_id: int

bundesliga_tippspiel.db.user_generated.MatchdayWinner module

class bundesliga_tippspiel.db.user_generated.MatchdayWinner.MatchdayWinner(*args, **kwargs)

Bases: jerrycan.db.ModelMixin.ModelMixin, sqlalchemy.orm.decl_api.Model

Model that describes the ‘matchday_winners’ SQL table

__init__(*args, **kwargs)

Initializes the Model :param args: The constructor arguments :param kwargs: The constructor keyword arguments

league: str
matchday: int
season: int
user: jerrycan.db.User.User
user_id: int

bundesliga_tippspiel.db.user_generated.SeasonWinner module

class bundesliga_tippspiel.db.user_generated.SeasonWinner.SeasonWinner(*args, **kwargs)

Bases: jerrycan.db.ModelMixin.ModelMixin, sqlalchemy.orm.decl_api.Model

Model that describes the ‘season_winners’ SQL table

__init__(*args, **kwargs)

Initializes the Model :param args: The constructor arguments :param kwargs: The constructor keyword arguments

league: str
season: int
property season_string: str
Returns

The season string, e.g. Bundesliga 2019/20

user: jerrycan.db.User.User
user_id: int

bundesliga_tippspiel.db.user_generated.UserProfile module

class bundesliga_tippspiel.db.user_generated.UserProfile.UserProfile(*args, **kwargs)

Bases: jerrycan.db.ModelMixin.ModelMixin, sqlalchemy.orm.decl_api.Model

Model that describes the ‘user_profiles’ SQL table

__init__(*args, **kwargs)

Initializes the Model :param args: The constructor arguments :param kwargs: The constructor keyword arguments

country: Optional[str]
description: Optional[str]
favourite_team: bundesliga_tippspiel.db.match_data.Team.Team
favourite_team_abbreviation: Optional[str]
user: jerrycan.db.User.User
user_id: int

Module contents