1
0
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:
Malcolm Tredinnick
2007-04-26 11:17:19 +00:00
parent 21d9387cea
commit f85f1d077a
2 changed files with 12 additions and 3 deletions

View File

@@ -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: