def url regex view kwargs None name None prefix regex regex -1 pages i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
def url(regex, view, kwargs=None, name=None, prefix=''):
regex = regex[:-1] + r'pages/(\d+)/$'
if isinstance(view, (list,tuple)):
urlconf_module, app_name, namespace = view
return RegexURLResolver(regex, urlconf_module, kwargs, app_name=app_name, namespace=namespace)
else:
if isinstance(view, basestring):
if not view:
raise ImproperlyConfigured('Empty URL pattern view name not '\
'permitted (for pattern %r)' % regex)
if prefix:
view = prefix + '.' + view
return RegexURLPattern(regex, view, kwargs, name)