mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #4129 -- Pass any prefix setting into url(...) constructions so that
prefixes work with the new syntax and strings for function names. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5086 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -102,6 +102,14 @@ class RegexURLPattern(object):
|
||||
self.default_args = default_args or {}
|
||||
self.name = name
|
||||
|
||||
def add_prefix(self, prefix):
|
||||
"""
|
||||
Adds the prefix string to a string-based callback.
|
||||
"""
|
||||
if not prefix or not hasattr(self, '_callback_str'):
|
||||
return
|
||||
self._callback_str = prefix + '.' + self._callback_str
|
||||
|
||||
def resolve(self, path):
|
||||
match = self.regex.search(path)
|
||||
if match:
|
||||
|
||||
Reference in New Issue
Block a user