diff -r -x .svn -U 5 django-src-orig/django/template/defaulttags.py django-src/django/template/defaulttags.py
old
|
new
|
|
338 | 338 | def render(self, context): |
339 | 339 | from django.core.urlresolvers import reverse, NoReverseMatch |
340 | 340 | args = [arg.resolve(context) for arg in self.args] |
341 | 341 | kwargs = dict([(smart_str(k,'ascii'), v.resolve(context)) for k, v in self.kwargs.items()]) |
342 | 342 | try: |
343 | | return reverse(self.view_name, args=args, kwargs=kwargs) |
| 343 | urlconf = None |
| 344 | if 'request' in context and hasattr(context['request'], 'urlconf'): |
| 345 | urlconf = context['request'].urlconf |
| 346 | return reverse(self.view_name, urlconf=urlconf, args=args, kwargs=kwargs) |
344 | 347 | except NoReverseMatch: |
345 | 348 | try: |
346 | 349 | project_name = settings.SETTINGS_MODULE.split('.')[0] |
347 | 350 | return reverse(project_name + '.' + self.view_name, args=args, kwargs=kwargs) |
348 | 351 | except NoReverseMatch: |