Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database for related matches #79

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

goodtune
Copy link
Owner

@goodtune goodtune commented Jun 16, 2024

  • chore: plpgsql function vitriolic_stage_group_position
  • feat: extend Match with home_team_title and away_team_title
  • test: make sure tests pass for Django 3.2 and 4.2
  • perf: remove logging statements that force database queries

goodtune added 6 commits May 27, 2024 16:56
This function mimicks the code in [`Match._get_team`][1] for translating
strings such as `P1` to `1st`, `G1P2` to `2nd Group 1`, or `S1G2P3` to
`3rd Stage 1 Group 2`, allowing it to be moved into the database.

[1]: https://github.com/goodtune/vitriolic/blob/11df430223fac1d24d01083a462b0bbecc6d1754/tournamentcontrol/competition/models.py#L1856-L1905
Use the custom `QuerySet` and `Manager` to annotate the objects using
`Case` logic.

The result is that `Match.get_home_team_plain()` should be equivalent to
`Match.home_team_title` (and also for the `away_team` variant).
- because I've used the migration framework to install the function I
  can no longer bypass it during database setup
- something changed in Django custom template loading in 4.1 which means
  that resolution was failing for the `FORM_FIELD_TEMPLATE` at module
  level, have moved inside the tag which is cleaner anyway.
Improve naive assumption that a stage must have a predecessor in order
to benefit from related match progressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant