Ticket #7049: defaulttags.diff
File defaulttags.diff, 1.4 KB (added by , 17 years ago) |
---|
-
defaulttags.py
357 357 def render(self, context): 358 358 from django.core.urlresolvers import reverse, NoReverseMatch 359 359 args = [arg.resolve(context) for arg in self.args] 360 view_name = self.view_name.resolve(context) 361 if not view_name: 362 view_name = self.view_name.token 360 363 kwargs = dict([(smart_str(k,'ascii'), v.resolve(context)) 361 364 for k, v in self.kwargs.items()]) 362 365 try: 363 return reverse( self.view_name, args=args, kwargs=kwargs)366 return reverse(view_name, args=args, kwargs=kwargs) 364 367 except NoReverseMatch: 365 368 try: 366 369 project_name = settings.SETTINGS_MODULE.split('.')[0] 367 return reverse(project_name + '.' + self.view_name,370 return reverse(project_name + '.' + view_name, 368 371 args=args, kwargs=kwargs) 369 372 except NoReverseMatch: 370 373 return '' … … 1050 1053 kwargs[k] = parser.compile_filter(v) 1051 1054 else: 1052 1055 args.append(parser.compile_filter(arg)) 1053 return URLNode( bits[1], args, kwargs)1056 return URLNode(parser.compile_filter(bits[1]), args, kwargs) 1054 1057 url = register.tag(url) 1055 1058 1056 1059 #@register.tag