Models¶
Database structural image¶
Athlete¶
-
class
results.models.athletes.Athlete(*args, **kwargs)¶ Stores a single athlete.
- Related to
Gender and date of birth are used for the result validation.
- Parameters
id (AutoField) – Id
first_name (CharField) – First name
last_name (CharField) – Last name
sport_id (CharField) – Sport id
date_of_birth (DateField) – Date of birth
gender (CharField) – Gender
organization (ForeignKey to
Organization) – Organizationno_auto_update (BooleanField) – No automatic updates
additional_organizations (ManyToManyField) – Additional organizations
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
AthleteInformation¶
-
class
results.models.athletes.AthleteInformation(*args, **kwargs)¶ Stores a single athlete specific information.
- Related to
- Parameters
id (AutoField) – Id
athlete (ForeignKey to
Athlete) – Athletetype (CharField) – Type
value (CharField) – Value
date_start (DateField) – Start date
date_end (DateField) – End date
visibility (CharField) – Visibility
modification_time (DateTimeField) – Suomisport update timestamp
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
Category¶
-
class
results.models.categories.Category(*args, **kwargs)¶ Stores a single category.
- Related to
categories.Sport
Defined values for a gender are M (Man), W (Woman), O (Other/Unknown).
- Parameters
id (AutoField) – Id
name (CharField) – Name
abbreviation (CharField) – Abbreviation
division (ForeignKey to
Division) – Divisionsport (ForeignKey to
Sport) – Sportmax_age (SmallIntegerField) – Maximum age
min_age (SmallIntegerField) – Minimum age
age_exact (BooleanField) – Age limit checked by the exact day, not year
team (BooleanField) – Team category
team_size (SmallIntegerField) – Number of team members
gender (CharField) – Gender
order (SmallIntegerField) – Order
historical (BooleanField) – Historical
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
CategoryForCompetitionType¶
-
class
results.models.categories.CategoryForCompetitionType(*args, **kwargs)¶ Stores a single competition type and category validation check.
- Related to
- Parameters
id (AutoField) – Id
category (ForeignKey to
Category) – Categorytype (ForeignKey to
CompetitionType) – Typemax_result (SmallIntegerField) – Maximum result
min_result (SmallIntegerField) – Minimum result
disallow (BooleanField) – Disallow category for this competition type
check_record (BooleanField) – Check records
record_group (SmallIntegerField) – Record group
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
Division¶
Competition¶
-
class
results.models.competitions.Competition(*args, **kwargs)¶ Stores a single competition.
- Related to
- Parameters
id (AutoField) – Id
name (CharField) – Name
description (TextField) – Description
date_start (DateField) – Start date
date_end (DateField) – End date
location (CharField) – Location
event (ForeignKey to
Event) – Eventorganization (ForeignKey to
Organization) – Organizationtype (ForeignKey to
CompetitionType) – Typelevel (ForeignKey to
CompetitionLevel) – Levellayout (SmallIntegerField) – Layout type
locked (BooleanField) – Edit lock
public (BooleanField) – Public
trial (BooleanField) – Trial competition
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
CompetitionLayout¶
-
class
results.models.competitions.CompetitionLayout(*args, **kwargs)¶ Stores a single competition layout.
- Related to
- Parameters
id (AutoField) – Id
type (SmallIntegerField) – Layout type
label (CharField) – Label
name (CharField) – Result type name
block (SmallIntegerField) – Block
row (SmallIntegerField) – Row
col (SmallIntegerField) – Column
order (SmallIntegerField) – Order
hide (CharField) – Hide on smaller screen
show (CharField) – Show on larger screen
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
CompetitionLevel¶
-
class
results.models.competitions.CompetitionLevel(*args, **kwargs)¶ Stores a single competition level.
- Parameters
id (AutoField) – Id
name (CharField) – Name
abbreviation (CharField) – Abbreviation
order (SmallIntegerField) – Order
requirements (CharField) – Requirements
historical (BooleanField) – Historical
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
CompetitionResultType¶
-
class
results.models.competitions.CompetitionResultType(*args, **kwargs)¶ Stores a single result type.
- Related to
- Parameters
id (AutoField) – Id
competition_type (ForeignKey to
CompetitionType) – Competition typename (CharField) – Name
abbreviation (CharField) – Abbreviation
max_result (SmallIntegerField) – Maximum result
min_result (SmallIntegerField) – Minimum result
records (BooleanField) – Check records
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
CompetitionType¶
-
class
results.models.competitions.CompetitionType(*args, **kwargs)¶ Stores a single competition type.
- Related to
categories.Sport
- Parameters
id (AutoField) – Id
name (CharField) – Name
abbreviation (CharField) – Abbreviation
sport (ForeignKey to
Sport) – Sportnumber_of_rounds (SmallIntegerField) – Number of rounds
max_result (SmallIntegerField) – Maximum result
min_result (SmallIntegerField) – Minimum result
order (SmallIntegerField) – Order
requirements (CharField) – Requirements
personal (BooleanField) – Personal competition
team (BooleanField) – Team competition
layout (SmallIntegerField) – Layout type
historical (BooleanField) – Historical
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
Event¶
-
class
results.models.events.Event(*args, **kwargs)¶ Stores a single event.
Related to -
organization.Organization- Parameters
id (AutoField) – Id
name (CharField) – Name
description (TextField) – Description
date_start (DateField) – Start date
date_end (DateField) – End date
location (CharField) – Location
organization (ForeignKey to
Organization) – Organizationlocked (BooleanField) – Edit lock
public (BooleanField) – Public
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
Area¶
Organization¶
-
class
results.models.organizations.Organization(*args, **kwargs)¶ Stores a single organization.
- Related to
organization.Area
- Parameters
id (AutoField) – Id
name (CharField) – Name
abbreviation (CharField) – Abbreviation
external (BooleanField) – External
group (OneToOneField to
Group) – Groupsport_id (CharField) – Sport id
historical (BooleanField) – Historical
areas (ManyToManyField) – Areas
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
Record¶
-
class
results.models.records.Record(*args, **kwargs)¶ Stores a single record.
- Parameters
id (AutoField) – Id
result (ForeignKey to
Result) – Resultpartial_result (ForeignKey to
ResultPartial) – Partial resultlevel (ForeignKey to
RecordLevel) – Leveltype (ForeignKey to
CompetitionType) – Typecategory (ForeignKey to
Category) – Categoryapproved (BooleanField) – Approved
date_start (DateField) – Start date
date_end (DateField) – End date
info (TextField) – Info
historical (BooleanField) – Historical
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
save(*args, **kwargs)¶ When saved, end approved and delete unapproved lower records.
RecordLevel¶
-
class
results.models.records.RecordLevel(*args, **kwargs)¶ Stores a single record level.
- Related to
- Parameters
id (AutoField) – Id
name (CharField) – Name
abbreviation (CharField) – Abbreviation
area (ForeignKey to
Area) – Areabase (BooleanField) – Base results
partial (BooleanField) – Partial results
personal (BooleanField) – Personal
team (BooleanField) – Team
decimals (BooleanField) – Decimals
order (SmallIntegerField) – Order
historical (BooleanField) – Historical
levels (ManyToManyField) – Levels
types (ManyToManyField) – Types
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
Result¶
-
class
results.models.results.Result(*args, **kwargs)¶ Stores a single result.
- Parameters
id (AutoField) – Id
competition (ForeignKey to
Competition) – Competitionathlete (ForeignKey to
Athlete) – Athletefirst_name (CharField) – First name
last_name (CharField) – Last name
organization (ForeignKey to
Organization) – Organizationcategory (ForeignKey to
Category) – Categoryelimination_category (ForeignKey to
Category) – Elimination categoryresult (DecimalField) – Result
result_code (CharField) – Result code
decimals (SmallIntegerField) – Result decimals
position (SmallIntegerField) – Position
position_pre (SmallIntegerField) – Preliminary position
approved (BooleanField) – Approved
info (CharField) – Additional information
admin_info (CharField) – Administrational information
team (BooleanField) – Team result
team_members (ManyToManyField) – Team members
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
save(*args, **kwargs)¶ Add result names from the athlete if not included. Set position_pre as position if not included and vice versa.
ResultPartial¶
-
class
results.models.results.ResultPartial(*args, **kwargs)¶ Stores a single partial result.
- Related to
- Parameters
id (AutoField) – Id
result (ForeignKey to
Result) – Resulttype (ForeignKey to
CompetitionResultType) – Typeorder (SmallIntegerField) – Order
value (DecimalField) – Value
decimals (SmallIntegerField) – Value decimals
time (DateTimeField) – Time
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
Sport¶
-
class
results.models.sports.Sport(*args, **kwargs)¶ Stores a single sport.
- Parameters
id (AutoField) – Id
name (CharField) – Name
abbreviation (CharField) – Abbreviation
order (SmallIntegerField) – Order
historical (BooleanField) – Historical
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶