Yield the next planned occurrences after the date "since"

        The `since` argument can be either a date or datetime onject.
        If not given, it defaults to the date of the last event that's
        already planned.

        If `n` is given, the result is limited to that many dates;
        otherwise, infinite results may be generated.
        Note that less than `n` results may be yielded.

def next_occurrences(self, n=None, since=None):
        """Yield the next planned occurrences after the date "since"

        The `since` argument can be either a date or datetime onject.
        If not given, it defaults to the date of the last event that's
        already planned.

        If `n` is given, the result is limited to that many dates;
        otherwise, infinite results may be generated.
        Note that less than `n` results may be yielded.
        """
        scheme = self.recurrence_scheme
        if scheme is None:
            return ()

        db = Session.object_session(self)
        query = db.query(Event)
        query = query.filter(Event.series_slug == self.slug)
        query = query.order_by(desc(Event.date))
        query = query.limit(1)
        last_planned_event = query.one_or_none()

        if since is None:
            last_planned_event = query.one()
            since = last_planned_event.date
        elif since < last_planned_event.date:
            since = last_planned_event.date

        start = getattr(since, 'date', since)

        start += relativedelta.relativedelta(days=+1)

        if (scheme == 'monthly'
                and last_planned_event
                and last_planned_event.date.year == start.year
                and last_planned_event.date.month == start.month):
            # Monthly events try to have one event per month, so exclude
            # the current month if there was already a meetup
            start += relativedelta.relativedelta(months=+1)
            start = start.replace(day=1)

        start = datetime.datetime.combine(start, datetime.time(tzinfo=CET))
        result = rrule.rrulestr(self.recurrence_rule, dtstart=start)
        if n is not None:
            result = itertools.islice(result, n)
        return result