示例#1
0
 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)
示例#2
0
 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)
示例#3
0
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)
示例#4
0
 def get(self, key):
     student = PermanentLinks.get(key)
     self.redirect(
         '/schedule?%s' %
         (settings.SCHEDULE_VIEW_ARGS %
          (student.faculty, student.group, student.course, student.form)))
示例#5
0
 def get(self, key):
     student = PermanentLinks.get(key)
     self.redirect('/schedule?%s' % (settings.SCHEDULE_VIEW_ARGS % (
         student.faculty, student.group, student.course, student.form
     )))
示例#6
0
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)