Files
Django_TasksApp/main
2026-09-30 17:25:25 +02:00
..
2026-09-30 17:25:25 +02:00
2026-09-30 17:25:25 +02:00
2026-09-30 17:25:25 +02:00
2026-09-30 17:25:25 +02:00
2026-09-30 17:25:25 +02:00

Tasknest development notes

Weather scheduling

The server gets a finite 16-day daily forecast from Open-Meteo and caches each user's normalized forecast for twelve hours. No browser code, template, or model calls Open-Meteo directly.

  • Dry rejects a day with precipitation probability of 40% or more, or 0.5 mm or more precipitation.
  • Sunny / mostly sunny also requires a clear/partly-cloudy condition and at least four hours of sunshine.
  • Warm requires a maximum temperature of at least 15 °C.
  • Dry and warm requires both of the corresponding rules.

If no forecast is available, a weather-dependent task remains visible rather than being treated as unsuitable. If a forecast finds an unsuitable natural occurrence, Tasknest creates a weather-owned occurrence shift to the first suitable vacancy in the finite forecast horizon. Natural recurrences and existing weather shifts are skipped, so an occurrence is never duplicated. The original recurrence anchor is not changed.

Deferral precedence is: manual, missed, and Sick Day state are evaluated before weather movement. Weather never overwrites those sources. Weather shifts are stored separately in TaskWeatherShift, so they can be recalculated without modifying user-owned deferrals.

Legacy ownership migration

Migration 0006 assigns old unowned tasks only when the database has exactly one active user. This local development database met that condition and its two existing tasks were assigned to that account. In a multi-user deployment the migration deliberately leaves legacy rows unowned instead of guessing; claim them explicitly before making ownership non-null at the database level.