def complete_ical(request, number=0): events = Event.future.get_n(long(number) if number != '' else 0) if not number: events = events.reverse() calendar = create_calendar([x.get_icalendar_event() for x in events]) return HttpResponse(calendar.to_ical(), mimetype='text/calendar; charset=utf-8')
def get_icalendar(self): return create_calendar([self.get_icalendar_event()])