Skip to main content
This page documents every model field extracted from the source code. Fields are grouped by model. Optional fields are those defined with null=True or blank=True.

Torneo

Defined in torneo/models.py. Represents a tournament.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
nombreCharField(100)yesTournament name
descripcionTextFieldnoOptional description
organizadorFK → OrganizadoryesOwner; protected from deletion
ganadorFK → EquiponoSet to NULL if the team is deleted
max_equiposPositiveIntegerFieldyesMaximum number of participating teams
deporteCharField(3)yesFUT · BAL · PAD
tipoCharField(3)yesLIG · ELI · ELG
playoffsBooleanFieldyesWhether the league includes a playoff phase (default False)
n_equipos_playoffsPositiveIntegerFieldconditionalRequired when playoffs=True; must be NULL when playoffs=False
descensoBooleanFieldyesWhether the league includes a relegation phase (default False)
n_equipos_descensoPositiveIntegerFieldconditionalRequired when descenso=True; must be NULL when descenso=False
playoffs and descenso are only relevant for tipo=LIG tournaments. Database check constraints enforce that the corresponding count fields are set if and only if their feature flag is True.

TorneoEquipo

Defined in torneo/models.py. Join table between Torneo and Equipo.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
torneoFK → TorneoyesCascades on delete
equipoFK → EquipoyesCascades on delete
nivelPositiveIntegerFieldnoSeeding level 14 (choices: Nivel)
Unique constraint: (torneo, equipo) — a team can only appear once in a tournament.

Jornada

Defined in torneo/models.py. A matchday in a league-type tournament.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
torneoFK → TorneoyesCascades on delete
n_jornadaPositiveIntegerFieldyesMatchday number
Unique constraint: (torneo, n_jornada) — matchday numbers are unique within a tournament.

Eliminatoria

Defined in torneo/models.py. Knockout bracket configuration for a tournament.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
torneoFK → TorneoyesCascades on delete
rondasPositiveIntegerFieldyesNumber of rounds, 15 (default 1)
Unique constraint: (torneo) — at most one Eliminatoria per tournament.

EliminatoriaGrupos

Defined in torneo/models.py. Group-stage configuration for a ELG-type tournament.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
torneoFK → TorneoyesCascades on delete
eliminatoriaFK → EliminatorianoThe knockout phase this group stage feeds into; NULL until created
n_clasificados_grupoPositiveIntegerFieldyesTeams that advance from each group (≥ 1)
n_gruposPositiveIntegerFieldyesNumber of groups, 132
Unique constraint: (torneo) — at most one EliminatoriaGrupos per tournament.

Clasificacion

Defined in torneo/models.py. One standings row for a team in a tournament (or group).
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
torneo_equipoFK → TorneoEquipoyesCascades on delete
eliminatoria_gruposFK → EliminatoriaGruposnoScopes the row to a group stage; NULL for league-wide standings
grupoCharField(20)yesGroup identifier; default "GENERAL"
posicionPositiveIntegerFieldyesCurrent rank within the group/table
puntosIntegerFieldyesPoints total (default 0)
victoriasPositiveIntegerFieldyesWins (default 0)
empatesPositiveIntegerFieldyesDraws (default 0)
derrotasPositiveIntegerFieldyesLosses (default 0)
anotacion_favorIntegerFieldyesGoals / points scored (default 0)
anotacion_contraIntegerFieldyesGoals / points conceded (default 0)
Unique constraint: (torneo_equipo, grupo) — one standings row per team per group.

Equipo

Defined in equipo/models.py. A sports team.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
nombreCharField(100)yesTeam name; unique across all teams
deporteCharField(3)yesFUT · BAL · PAD
userOneToOne → UseryesLinked Django user account; cascades on delete

Administrador

Defined in usuario/models.py. Administrator profile.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
nombreCharField(100)yesDisplay name
userOneToOne → UseryesLinked Django user account; cascades on delete

Organizador

Defined in usuario/models.py. Tournament organizer profile.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
nombreCharField(100)yesDisplay name
userOneToOne → UseryesLinked Django user account; cascades on delete

Jugador

Defined in usuario/models.py. An individual player.
FieldTypeRequiredNotes
dniCharField(9)yesPrimary key. Format: 8 digits followed by one uppercase letter (e.g. 12345678A)
nombreCharField(100)yesFirst name
apellidosCharField(150)yesSurname(s)
es_porteroBooleanFieldyesTrue if the player is a goalkeeper (default False)
userOneToOne → UseryesLinked Django user account; cascades on delete
equipoFK → EquiponoTeam the player belongs to; set to NULL if the team is deleted
dni is the primary key for Jugador. Django does not auto-generate an id column for this model.

Enfrentamiento

Defined in enfrentamiento/models.py. A single match.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
eliminatoriaFK → EliminatoriaconditionalSet for knockout matches; mutually exclusive with jornada
jornadaFK → JornadaconditionalSet for league matchday matches; mutually exclusive with eliminatoria
rondaCharField(4)noKnockout round: 16AV · 8AV · CUA · SEM · FIN
equipo_localFK → EquiponoHome team; set to NULL if team is deleted
equipo_visitanteFK → EquiponoAway team; set to NULL if team is deleted
ganadorFK → EquiponoMatch winner; must be equipo_local or equipo_visitante if set
anotacion_localPositiveIntegerFieldnoHome score
anotacion_visitantePositiveIntegerFieldnoAway score
juegos_local_1PositiveIntegerFieldnoPádel: home games in set 1
juegos_visitante_1PositiveIntegerFieldnoPádel: away games in set 1
juegos_local_2PositiveIntegerFieldnoPádel: home games in set 2
juegos_visitante_2PositiveIntegerFieldnoPádel: away games in set 2
juegos_local_3PositiveIntegerFieldnoPádel: home games in set 3
juegos_visitante_3PositiveIntegerFieldnoPádel: away games in set 3
prev_localFK → Enfrentamiento (self)noPrevious match whose winner fills the home slot
prev_visitanteFK → Enfrentamiento (self)noPrevious match whose winner fills the away slot
Database constraints:
  • Exactly one of eliminatoria or jornada must be non-null.
  • equipo_local and equipo_visitante must be different teams.
  • ganador must be NULL, equipo_local, or equipo_visitante.

EstadisticasFutbol

Defined in estadisticas/models.py. Aggregated football statistics for a player in a tournament.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
torneoFK → TorneoyesCascades on delete
jugadorFK → JugadoryesCascades on delete
golesPositiveIntegerFieldyesGoals scored (default 0)
asistenciasPositiveIntegerFieldyesAssists (default 0)
goles_contraPositiveIntegerFieldnoGoals conceded by the goalkeeper (default 0); NULL for non-goalkeepers
Unique constraint: (torneo, jugador).

EstadisticasBaloncesto

Defined in estadisticas/models.py. Aggregated basketball statistics for a player in a tournament.
FieldTypeRequiredNotes
idBigAutoFieldautoPrimary key
torneoFK → TorneoyesCascades on delete
jugadorFK → JugadoryesCascades on delete
puntosPositiveIntegerFieldyesPoints (default 0)
rebotesPositiveIntegerFieldyesRebounds (default 0)
asistenciasPositiveIntegerFieldyesAssists (default 0)
Unique constraint: (torneo, jugador).

Enumeration types

All choices are defined in gestor/choices.py.
Choice classValues
DeporteFUT (Fútbol) · BAL (Baloncesto) · PAD (Pádel)
TipoTorneoLIG (Liga) · ELI (Eliminatoria) · ELG (Eliminatoria con Fase de Grupos)
TipoRonda16AV · 8AV · CUA · SEM · FIN
Nivel1 · 2 · 3 · 4
TipoUsuarioADM · ORG · EQ · JUG