app/soc/views/helper/redirects.py
changeset 2726 0d9e4b0a9d3c
parent 2707 ffabb3576744
child 2777 9dd7c21e330b
--- a/app/soc/views/helper/redirects.py	Tue Aug 04 16:52:41 2009 +0200
+++ b/app/soc/views/helper/redirects.py	Tue Aug 04 16:57:27 2009 +0200
@@ -421,6 +421,22 @@
                                      entity.key().id_or_name())
 
 
+def getViewSurveyRecordRedirect(entity, params):
+  """Returns the redirect for view a Survey Record
+  for the given Survey Record.
+
+  Args:
+      entity: a Survey Record entity
+      params: params for a Survey view
+      
+  """
+
+  return '/%s/record/%s?id=%s' % (
+      params['url_name'],
+      entity.survey.key().id_or_name(),
+      entity.key().id_or_name())
+
+
 def getEditGradingRecordRedirect(entity, params):
   """Returns the redirect for editing a given GradingRecord.
   """
@@ -449,3 +465,10 @@
     return None
 
   return getPublicRedirect(tos_doc, {'url_name': 'document'})
+
+
+def getSubscribeRedirect(entity, params):
+  """Redirects to subscription XML doc for an entity
+  """
+  return'/%s/subscribe/%s' % (
+      params['url_name'], entity.key().name())