def getConflictingEvents(self, resource):
"""Return a list of events that would conflict when booking resource."""
events = []
if not canAccess(resource.calendar, "expand"):
return events
if self.context.recurrence:
totest = []
for d in self.context.recurrence.apply(self.context): totest.append(datetime(d.year, d.month, d.day, self.context.dtstart.hour, self.context.dtstart.minute, self.context.dtstart.second, self.context.dtstart.microsecond, self.context.dtstart.tzinfo))
else:
totest = [self.context.dtstart]
for d in totest:
for event in resource.calendar.expand(d,d + self.context.duration):
if event != self.context: events.append(EventForBookingDisplay(event))
return events
def getConflictingE vents(self, resource): resource. calendar, "expand"): recurrence: recurrence. apply(self. context) :
totest. append( datetime( d.year, d.month, d.day, self.context. dtstart. hour, self.context. dtstart. minute, self.context. dtstart. second, self.context. dtstart. microsecond, self.context. dtstart. tzinfo) ) dtstart] calendar. expand( d,d + self.context. duration) :
events. append( EventForBooking Display( event))
"""Return a list of events that would conflict when booking resource."""
events = []
if not canAccess(
return events
if self.context.
totest = []
for d in self.context.
else:
totest = [self.context.
for d in totest:
for event in resource.
if event != self.context:
return events