def ics_classes_user(request,u_id,api_key,fname): user = get_object_or_404(get_user_model(),pk=u_id,usermembership__api_key=api_key) enrollments = user.enrollment_set.all() sessions = [e.session for e in enrollments] sessions += user.session_set.all() occurrences = [] for session in sessions: occurrences += session.classtime_set.filter(start__gte=timezone.now()-datetime.timedelta(30)) calendar_object = make_ics(occurrences,title="%sMy Classes"%settings.EMAIL_SUBJECT_PREFIX) return ics2response(calendar_object,fname=fname)
def ics_classes_all(request,fname): occurrences = ClassTime.objects.all() calendar_object = make_ics(occurrences,title="%s Classes"%settings.SITE_NAME) return ics2response(calendar_object,fname=fname)
def ics_classes_all(request,fname): occurrences = ClassTime.objects.filter(start__gte=timezone.now()-datetime.timedelta(30)) calendar_object = make_ics(occurrences,title="%s Classes"%settings.SITE_NAME) return ics2response(calendar_object,fname=fname)