Ticket #10980: url_tag_dynamic_viewnames.patch
File url_tag_dynamic_viewnames.patch, 1.2 KB (added by , 16 years ago) |
---|
-
defaulttags.py
378 378 # re-raise the NoReverseMatch unless we're using the 379 379 # {% url ... as var %} construct in which cause return nothing. 380 380 url = '' 381 view_name = self.view_name.resolve(context) 381 382 try: 382 url = reverse( self.view_name, args=args, kwargs=kwargs)383 url = reverse(view_name, args=args, kwargs=kwargs) 383 384 except NoReverseMatch: 384 385 project_name = settings.SETTINGS_MODULE.split('.')[0] 385 386 try: 386 url = reverse(project_name + '.' + self.view_name,387 url = reverse(project_name + '.' + view_name, 387 388 args=args, kwargs=kwargs) 388 389 except NoReverseMatch: 389 390 if self.asvar is None: … … 1101 1102 if len(bits) < 2: 1102 1103 raise TemplateSyntaxError("'%s' takes at least one argument" 1103 1104 " (path to a view)" % bits[0]) 1104 viewname = bits[1]1105 viewname = parser.compile_filter(bits[1]) 1105 1106 args = [] 1106 1107 kwargs = {} 1107 1108 asvar = None