Premier League Predictor: Django & MySQL — Chapter 9, Exercise 3 ==================================================== TASK Complete a full real season (enter results for enough fixtures to give every team a real record), call relegation_preview, create a new empty Season in the admin, call rollover_survivors, confirm the new season has exactly 17 SeasonTeam rows, then add 3 promoted teams via SeasonTeamInline (using the "+" popup for at least one genuinely new team) and confirm the new season's roster reaches exactly 20. SOLUTION Using old_season_id 1 (2026/27, fully completed) and a freshly created new_season_id 2 (2027/28, no SeasonTeam rows yet): 1. Enter results for enough fixtures via enter_result that every one of the 20 teams in season 1 has at least a partial real record — compute_league_table depends only on played fixtures existing, not a fully finished 38-gameweek season, so a handful of results per team is enough for this exercise. 2. GET /seasons/1/relegation-preview/: [ {"id": 18, "name": "Sheffield United", "short_name": "SHU"}, {"id": 19, "name": "Luton Town", "short_name": "LUT"}, {"id": 20, "name": "Burnley", "short_name": "BUR"} ] These are the three teams currently sitting bottom of season 1's real table, per its own points/goal-difference/goals-for ordering. 3. In the admin, create a new Season named "2027/28" with is_current left False for now (id 2). No SeasonTeam rows exist for it yet. 4. POST /seasons/2/rollover-survivors-from/1/: { "new_season_id": 2, "survivors_carried_forward": 17, "next_step": "Add the 3 promoted teams via the Season admin page's own SeasonTeamInline" } Checking SeasonTeam.objects.filter(season_id=2).count() in the shell now returns 17 — every team from season 1's table except Sheffield United, Luton Town, and Burnley (the three names returned by relegation_preview in step 2). 5. Open the new Season (id 2) in the admin. Its SeasonTeamInline shows the 17 survivors already present, and correctly still allows up to 3 more rows before max_num=20/validate_max=True blocks any further addition. 6. Add the 3 promoted teams: "Leicester City" (an existing Team row from a previous season, found via the ordinary autocomplete search), "Ipswich Town" (also existing), and "Real Newco FC" (a genuinely brand-new club with no existing Team row at all, added via the "+" popup next to the team autocomplete field, which opens a small form to create the Team on the spot without leaving the Season admin page). Save the inline. 7. SeasonTeam.objects.filter(season_id=2).count() now returns 20 — the 17 survivors plus the 3 just added — and a 21st attempted addition on this same inline is rejected by validate_max=True, confirming the cap still holds even after being reached through two different mechanisms (the automated rollover and the manual admin entries) rather than just one. WHY THIS WORKS AS AN ANSWER ---------------------------- It walks the full real sequence end to end — preview, create, roll over the mechanical part, then complete the human part through the admin, including the specific "+" popup case the task calls for — and confirms the row counts at each stage (17 after rollover, 20 after the admin additions), tying the result directly back to both the relegation_preview's own returned team names and the max_num cap established in Chapter 3.