leaguemanager.models.base

Base classes for database objects are loosely based on IPTC Sport Schema. see: https://sportschema.org

Module Contents

Classes

UUIDBase

UUIDAuditBase

GoverningBodyBase

Base class for organization responsible for running competitions.

CompetitionBase

Base class for competitions. Can be child of Governing Body or other Competitions.

CompetitionPhaseBase

A sub-group of events within a competition (i.e., regular, semifinals, knockout round, etc…)

EventBase

Base class for an event (match/fixture) that produces results.

ActionBase

Base class for actions related to an event.

PropertiesBase

Base class for rules or properties.

AgentBase

Base class for Individual, Team, or Club.

IndividualBase

All individuals will inherit these properties, but properties optional to allow anonymous usage.

MembershipBase

Defines membership of an entity in another entity for a given time.

SiteBase

Base class for a given site.

ParticipationBase

Base class for modeling participation of an actor in an event.

TeamParticipationBase

Base class for team stats in an Event.

OfficialParticipationBase

Base class for involvement of Officials in an Event.

IndividualParticipationBase

Base class for individual stats in an Event.

Data

mapper

metadata

API

leaguemanager.models.base.mapper

‘registry(…)’

leaguemanager.models.base.metadata

‘MetaData(…)’

class leaguemanager.models.base.UUIDBase
id: uuid.UUID

‘field(…)’

to_dict(exclude: set[str] | None = None) dict[str, Any]

Convert model to dictionary.

Returns: Dict[str, Any]: A dict representation of the model

str_to_iso(format: str)

Converts string to datetime object.

class leaguemanager.models.base.UUIDAuditBase

Bases: leaguemanager.models.base.UUIDBase

created_at: datetime.datetime

‘field(…)’

updated_at: datetime.datetime

‘field(…)’

class leaguemanager.models.base.GoverningBodyBase

Bases: leaguemanager.models.base.UUIDAuditBase

Base class for organization responsible for running competitions.

org_type: str | None

‘field(…)’

class leaguemanager.models.base.CompetitionBase

Bases: leaguemanager.models.base.UUIDAuditBase

Base class for competitions. Can be child of Governing Body or other Competitions.

The competition_type attribute should describe whether the object is meant to be a recurring construct (i.e., recurring-competition), or something finite (i.e., competition, tournament). The value of this property will vary based on the object that inherits this class.

#TODO: May need to create a constraint with pre-determined types.

class leaguemanager.models.base.CompetitionPhaseBase

Bases: leaguemanager.models.base.CompetitionBase

A sub-group of events within a competition (i.e., regular, semifinals, knockout round, etc…)

phase_type: str | None

‘field(…)’

class leaguemanager.models.base.EventBase

Bases: leaguemanager.models.base.UUIDAuditBase

Base class for an event (match/fixture) that produces results.

class leaguemanager.models.base.ActionBase

Bases: leaguemanager.models.base.UUIDAuditBase

Base class for actions related to an event.

class leaguemanager.models.base.PropertiesBase

Bases: leaguemanager.models.base.UUIDAuditBase

Base class for rules or properties.

class leaguemanager.models.base.AgentBase

Bases: leaguemanager.models.base.UUIDAuditBase

Base class for Individual, Team, or Club.

class leaguemanager.models.base.IndividualBase

Bases: leaguemanager.models.base.AgentBase

All individuals will inherit these properties, but properties optional to allow anonymous usage.

first_name: str | None

‘field(…)’

last_name: str | None

‘field(…)’

middle_name: str | None

‘field(…)’

full_name: str | None

‘field(…)’

alias: str | list[str] | None

‘field(…)’

email: str | None

‘field(…)’

mobile_phone: str | None

‘field(…)’

class leaguemanager.models.base.MembershipBase

Bases: leaguemanager.models.base.UUIDAuditBase

Defines membership of an entity in another entity for a given time.

class leaguemanager.models.base.SiteBase

Bases: leaguemanager.models.base.UUIDBase

Base class for a given site.

class leaguemanager.models.base.ParticipationBase

Bases: leaguemanager.models.base.UUIDAuditBase

Base class for modeling participation of an actor in an event.

class leaguemanager.models.base.TeamParticipationBase

Bases: leaguemanager.models.base.ParticipationBase

Base class for team stats in an Event.

class leaguemanager.models.base.OfficialParticipationBase

Bases: leaguemanager.models.base.ParticipationBase

Base class for involvement of Officials in an Event.

class leaguemanager.models.base.IndividualParticipationBase

Bases: leaguemanager.models.base.ParticipationBase

Base class for individual stats in an Event.