app/soc/views/helper/params.py
changeset 680 7f047b2a2d3a
parent 679 77a286ff6667
child 689 46db8c4bbffc
--- a/app/soc/views/helper/params.py	Sat Dec 06 14:23:53 2008 +0000
+++ b/app/soc/views/helper/params.py	Sat Dec 06 14:24:26 2008 +0000
@@ -101,6 +101,7 @@
   new_params['key_fields_prefix'] = []
   new_params['link_id_arg_pattern'] = linkable.LINK_ID_ARG_PATTERN
   new_params['link_id_pattern_core'] = linkable.LINK_ID_PATTERN_CORE
+  new_params['scope_path_pattern'] = getScopePattern(params)
 
   new_params['django_patterns'] = None
   new_params['extra_django_patterns'] = []
@@ -111,6 +112,8 @@
           'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'),
       (r'^%(url_name)s/create/%(key_fields)s$',
           'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'),
+      (r'^%(url_name)s/create/%(scope)s$',
+          'soc.views.models.%(module_name)s.create', 'Create %(name_short)s'),
       (r'^%(url_name)s/delete/%(key_fields)s$',
           'soc.views.models.%(module_name)s.delete', 'Delete %(name_short)s'),
       (r'^%(url_name)s/edit/%(key_fields)s$',
@@ -246,7 +249,7 @@
 
   for name in names:
     if name == 'scope_path':
-      pattern = getScopePattern(params)
+      pattern = params['scope_path_pattern']
     else:
       pattern = r'(?P<%s>%s)' % (name, linkable.LINK_ID_PATTERN_CORE)
     patterns.append(pattern)