Permalink
Browse files

Add back 1.0.X compatibility for Router URL resolution.

Signed-off-by: Simon Willison <simon@simonwillison.net>
  • Loading branch information...
brosner authored and Simon Willison committed May 21, 2009
1 parent 2256084 commit b7b0724b7f663a8a0d0e5c46d66f42726d700f45
Showing with 4 additions and 1 deletion.
  1. +4 −1 djng/router.py
View
@@ -18,7 +18,10 @@ class Router(object):
"""
def __init__(self, *urlpairs):
self.urlpatterns = patterns('', *urlpairs)
- self.resolver = urlresolvers.RegexURLResolver(r'^/', self)
+ # for 1.0 compatibility we pass in None for urlconf_name and then
+ # modify the _urlconf_module to make self hack as if its the module.
+ self.resolver = urlresolvers.RegexURLResolver(r'^/', None)
+ self.resolver._urlconf_module = self
def handle(self, request):
path = request.path_info

0 comments on commit b7b0724

Please sign in to comment.