Move the method current_season_distinct_week_infos to the 'week' model #414
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web#414
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Also, should be re-written to just return the rows in the table, converted to WeekInfos
While I'm at it, I should probably update the description in the WeekInfo class to describe WHY I pass that object around (pickling, decoupling from the model, etc...) instead of a 'Week' class
Supersedes a bullet in #409, which described the same change ("queries
weekdirectly, theDISTINCTovergamedisappears entirely"). That bulletis now struck there and points here. Do it once, here, because this issue also
moves the method onto
Week, which #409 did not say.Blocked on
odds_state(#408). "Just return the rows in the table" rendersweek-picker links for weeks whose picks page has not been released. The
DISTINCTovergameis currently acting as that filter by accident — whichis exactly the games-exist / page-released fusion #406 is unwinding, so it
cannot simply be kept. Filter on
odds_state == LOCKEDinstead, which meansthis lands after #408's migration.
It dissolves an import edge, and that settles a design question in #408.
app/models/game.py:162is the only use ofWeekin that file, inside thisvery method. Once it moves,
game.pydropsfrom .week import Weekand thereis no import edge between
gameandweekin either direction — so thegame -> week -> gamecycle that #408 cited as its reason for keeping thestate calculation off
Weekstops existing. Worth doing before #408 starts, sothat phase is argued on design grounds rather than on a constraint that is
about to disappear. (The conclusion does not change: the fold still belongs on
Game, because the principle this issue establishes is thatWeekanswersfrom the
weektable alone.)Hold the
WeekInfodocstring until #410. The intended rationale is"pickling, decoupling from the model" — but #410's first task is stop pickling
WeekInfointo APScheduler args, after theModuleNotFoundErrorthatsilently ate the stored
create_picksjob. If that lands, pickling is nolonger a reason
WeekInfoexists and decoupling is the only one left. Writingit first documents a rationale that is about to be deleted.
Order
#408 (migration adds
odds_state) → this → #409.Game.week_idforeign key #409