Hi all,
I have two Django models; MonitoringPeriod
and AssignmentPeriod
. Both models have start_date
and end_date
fields. A MonitoringPeriod
can be covered by one or more AssignmentPeriod
instances, which may or may not cover the entire range defined by the start and end of the MonitoringPeriod
, and may or may not overlap. A MonitoringPeriod
would be classed as "fully covered" if all distinct dates between its start_date
and end_date
are included in the set of dates specified by its related AssignmentPeriods.
This is somewhat trivial to define in raw SQL but I'd prefer to do it in the ORM query setting - any ideas?
More details and class definitions, as well as raw SQL are available here:
Many thanks in advance for any guidance!
S