Entity overview
| Entity | App | Purpose |
|---|---|---|
User | django.contrib.auth | Django built-in authentication user |
Administrador | usuario | Administrator profile linked to a User |
Organizador | usuario | Organizer profile linked to a User |
Equipo | equipo | Team profile linked to a User |
Jugador | usuario | Player profile linked to a User, optionally belonging to an Equipo |
Torneo | torneo | A tournament with a sport, type, and configuration |
TorneoEquipo | torneo | Join table between Torneo and Equipo (many-to-many with extra data) |
Jornada | torneo | A matchday within a league-format tournament |
Eliminatoria | torneo | Knockout bracket configuration for a tournament |
EliminatoriaGrupos | torneo | Group-stage configuration that leads into an Eliminatoria |
Clasificacion | torneo | Standings row for a TorneoEquipo, optionally scoped to a group |
Enfrentamiento | enfrentamiento | A single match, belonging to either a Jornada or an Eliminatoria |
EstadisticasFutbol | estadisticas | Aggregated football stats per player per tournament |
EstadisticasBaloncesto | estadisticas | Aggregated basketball stats per player per tournament |
Relationship map
User profiles
Every user in the system is a standard DjangoUser. Role-specific data lives in a separate profile model linked via a OneToOneField:
- Administrador — platform administrators.
- Organizador — can create and manage tournaments.
- Equipo — a team account; a single
Userrepresents the entire team. - Jugador — an individual player. Players optionally belong to an
Equipo.
User has at most one of each profile type at a time.
Tournaments
ATorneo belongs to an Organizador and has a sport (FUT, BAL, PAD) and a type:
| Type code | Name | Structure |
|---|---|---|
LIG | Liga | Round-robin league with Jornadas |
ELI | Eliminatoria | Knockout bracket only |
ELG | Eliminatoria con Fase de Grupos | Group stage feeding into a knockout bracket |
playoffs, descenso) add a playoff or relegation phase on top of the league table.
Many-to-many: Torneo ↔ Equipo
TorneoEquipo is the explicit join table between Torneo and Equipo. It carries an optional nivel (1–4) that can be used to seed or rank teams. Each (torneo, equipo) pair is unique.
Every TorneoEquipo record can have one or more Clasificacion rows — one per group the team participates in (defaulting to "GENERAL" for league-wide standings).
Match structure
AnEnfrentamiento (match) always belongs to exactly one of:
- A
Jornada— for league rounds. - An
Eliminatoria— for knockout matches.
ronda field (16AV, 8AV, CUA, SEM, FIN) identifies the knockout round. Bracket progression is encoded with prev_local and prev_visitante self-referential foreign keys: the winner of a previous match populates the local or visiting slot of the next match.
Pádel matches include per-set scores (juegos_local_1/juegos_visitante_1 … _3).
Statistics
Aggregated tournament statistics are stored per(Torneo, Jugador) pair:
EstadisticasFutbol— goals, assists, and goals conceded (goalkeeper stat).EstadisticasBaloncesto— points, rebounds, assists.
EstadisticasEnfrentamiento and GuardadoEnfrentamiento (draft/staging), both living in the enfrentamiento app.