app/soc/views/helper/params.py
changeset 1094 e143974a6e27
parent 1093 05ac761edb27
child 1101 6c0f9b73b053
--- a/app/soc/views/helper/params.py	Fri Jan 30 22:00:23 2009 +0000
+++ b/app/soc/views/helper/params.py	Fri Jan 30 22:00:49 2009 +0000
@@ -269,11 +269,24 @@
   """
 
   names = params['logic'].getKeyFieldNames()
+  scope_path_pattern = params['scope_path_pattern']
+
+  return getPattern(names, scope_path_pattern)
+
+
+def getPattern(names, scope_path_pattern):
+  """Returns the Django patterns for the specified names.
+
+  Args:
+    names: the field names that should be included in the pattern
+    scope_path_pattern: the pattern to use if the name is 'scope_path'
+  """
+
   patterns = []
 
   for name in names:
     if name == 'scope_path':
-      pattern = params['scope_path_pattern']
+      pattern = scope_path_pattern
     else:
       pattern = r'(?P<%s>%s)' % (name, linkable.LINK_ID_PATTERN_CORE)
     patterns.append(pattern)