def get(self): context = get_anonymous_context() context['link_key'] = add_permalink_and_get_key(form=int(self.request.get('form')), course=int(self.request.get('course')), group=int(self.request.get('group')), faculty=int(self.request.get('faculty'))) links = PermanentLinks.get(context['link_key']) context['schedule'] = {'week': bseu_schedule.fetch_and_show_week(links), 'semester': bseu_schedule.fetch_and_show_semester(links)} self.render_to_response('templates/html/main.html', context)
def get(self): context = get_anonymous_context() try: context['link_key'] = add_permalink_and_get_key(form=int(self.request.get('form')), course=int(self.request.get('course')), group=int(self.request.get('group')), faculty=int(self.request.get('faculty'))) except ValueError: self.redirect('/') else: links = PermanentLinks.get(context['link_key']) context['schedule'] = {'week': bseu_schedule.fetch_and_show_week(links), 'semester': bseu_schedule.fetch_and_show_semester(links)} self.render_to_response('templates/html/main.html', context)
def increment_course_and_cleanup_graduates(): for student in Student.all().run(): _increment_or_delete(student) for link in PermanentLinks.all().run(): _increment_or_delete(link)
def get(self, key): student = PermanentLinks.get(key) self.redirect( '/schedule?%s' % (settings.SCHEDULE_VIEW_ARGS % (student.faculty, student.group, student.course, student.form)))
def get(self, key): student = PermanentLinks.get(key) self.redirect('/schedule?%s' % (settings.SCHEDULE_VIEW_ARGS % ( student.faculty, student.group, student.course, student.form )))