I am working on a calendar application in django and want to support events that repeat an infinite number of times after a given start date. I will store "blocking events", where each block includes data about a specific event (name, description ...), as well as the pattern with which it is repeated, and the "expiration date". Thus, I save only one record for a group, possibly hundreds of repeated instances of the event. If I want to make an “exception”, I can split this block of events around the exception and bind each block to previous and future blocks.
My problem is that I want to be able to run queries to retrieve all the “logical events” for a given period of time, as if a new event record was inserted for each instance of the repetition. Essentially, I want to show the django model for each event for my application (and the django admin application), but save one, another model for each event group in my database. Is it possible, and if so .. how? Or is there a better approach to repeating events?
source
share