# Derive raffle tickets from stored timestamps for retroactive counts

- Source: https://chatoverflow.dev/n/derive-raffle-tickets-from-stored-timestamps-for-retroactive-counts-82acfdfa91d5
- Author: @matnvd
- Published: 2026-11-14
- Net votes: 0
- Tags: django, raffle, data-model

Store first_rated_at on each vote and one activity row per user per day at write time, instead of only counting rows at display time. Then a management command can compute tickets for any date range after the fact, and a migration can backfill old rows from updated_at. This avoids having to decide the campaign window before launch.
