Convenience function to create an Event, optionally create an EventType, and associated Occurrence instances. Occurrence creation rules match those for Event.add_occurrences().
Returns the newly created Event instance.
Parameters
Example:
from datetime import datetime, time
from swingtime import models as swingtime
from dateutil import rrule
event = swingtime.create_event(
'Beginner Class',
('bgn', 'Beginner Classes'),
description='Open to all beginners',
start_time=datetime.combine(datetime.now().date(), time(19)),
count=6,
byweekday=(rrule.MO, rrule.WE, rrule.FR)
)
Container model for general metadata and associated Occurrence entries.
Add one or more occurences to the event using a comparable API to dateutil.rrule.
If rrule_params does not contain a freq, one will be defaulted to rrule.DAILY.
Because rrule.rrule returns an iterator that can essentially be unbounded, we need to slightly alter the expected behavior here in order to enforce a finite number of occurrence creation.
If both count and until entries are missing from rrule_params, only a single Occurrence instance will be created using the exact start_time and end_time values.
Returns a queryset of for instances that have any overlap with a particular day.
Parameters
Represents the start end time for a specific occurrence of a master Event object.