app/soc/views/models/base.py
changeset 560 a32be584ee04
parent 555 3cdfb42d941b
child 563 4a8565ce48c6
--- a/app/soc/views/models/base.py	Sat Nov 22 18:16:42 2008 +0000
+++ b/app/soc/views/models/base.py	Sat Nov 22 18:22:36 2008 +0000
@@ -140,7 +140,7 @@
     new_params['list_row'] = 'soc/%(module_name)s/list/row.html' % params
     new_params['list_heading'] = 'soc/%(module_name)s/list/heading.html' % params
 
-    new_params['list_action'] = '/' + params['url_name'] + '/edit'
+    new_params['list_action'] = (self.getEditRedirect, None)
     new_params['list_params'] = {
         'list_action': 'action',
         'list_description': 'description',
@@ -443,6 +443,14 @@
 
     return http.HttpResponseRedirect(redirect)
 
+  def getEditRedirect(self, entity, _):
+    """Returns the edit redirect for the specified entity
+    """
+
+    suffix = self._logic.getKeySuffix(entity)
+    url_name = self._params['url_name']
+    return '/%s/edit/%s' % (url_name, suffix)
+
   def _editPost(self, request, entity, fields):
     """Performs any required processing on the entity to post its edit page.