--- a/app/soc/views/helper/redirects.py Fri Jan 23 21:04:45 2009 +0000
+++ b/app/soc/views/helper/redirects.py Fri Jan 23 21:15:16 2009 +0000
@@ -94,7 +94,36 @@
return result
-def getInviteAcceptedRedirect(entity, _):
+def getSelectRedirect(entity, params):
+ """Returns the pick redirect for the specified entity
+ """
+
+ if entity:
+ result = '/%s/pick?scope_path=%s&field=%s&continue=%s' % (
+ params['url_name'], entity.key().name(),
+ params['field_name'], params['return_url'])
+ else:
+ result = '/%s/pick?field=%s&continue=%s' % (
+ params['url_name'], params['field_name'], params['return_url'])
+
+ return result
+
+
+def getReturnRedirect(return_url, field):
+ """Returns a function that has return_url and field embedded
+ """
+
+ def wrapped(entity, params):
+ """Returns the return redirect for the specified entity
+ """
+
+ result = '%s?field=%s&value=%s' % (
+ return_url, field, entity.link_id)
+ return result
+
+ return wrapped
+
+def inviteAcceptedRedirect(entity, _):
"""Returns the redirect for accepting an invite.
"""