Advertisement
Guest User

Untitled

a guest
Apr 20th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1. class SubscribedTasksPage(GCIRequestHandler):
  2.   """View for the list of the tasks the specified profile is subscribed to."""
  3.  
  4.   def templatePath(self):
  5.     return 'v2/modules/gci/leaderboard/student_tasks.html'
  6.  
  7.   def djangoURLPatterns(self):
  8.     return [
  9.         url(r'subscribed_tasks/%s$' % url_patterns.PROFILE, self,
  10.             name=url_names.GCI_SUBSCRIBED_TASKS),
  11.     ]
  12.  
  13.   def checkAccess(self, data, check, mutator):
  14.     mutator.profileFromKwargs()
  15.     check.hasProfile()
  16.     if data.profile.key() != data.url_profile.key():
  17.         raise AccessViolation('You do not have access to this data')
  18.  
  19.   def jsonContext(self, data, check, mutator):
  20.     return SubscribedTasksList(data).getListData().content()
  21.  
  22.   def context(self, data, check, mutator):
  23.     return {
  24.         'page_name': "Tasks %s is subscribed to" % data.url_profile.name(),
  25.         'tasks_list': SubscribedTasksList(data),
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement