One Item model, not separate Bookmark and Event models¶
The app began with two models in two apps: Bookmark (a URL someone saved) and Event
(a title with a date and time). In practice they were the same thing at different points
in its life — a saved link would later get a date, and copying it across meant the link,
note and author had to be duplicated or joined. We merged them into a single Item with a
Status of Open, Scheduled or Done, and deleted both apps (commit 86c09c4).
Consequences¶
- The wishlist and the calendar are two filters over one table, not two tables. Scheduling is a status change, not a cross-model copy.
- A database constraint (
scheduled_items_have_datetime) carries the rule that separate models used to get for free: a Scheduled Item must have both a date and a time. - Nullable
scheduled_date/scheduled_timecolumns exist on every Item, including ones that will never be scheduled. Accepted as the cost of the merge. - URL names and template directories still say "event" and "calendar_entries" in places.
These are historical; see
CONTEXT.mdon why Event is not a domain term.