1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Corrected [13479], accounting for unnamed urls that are instances of classes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-08-06 13:47:56 +00:00
parent 75ac6c26da
commit 69d1e71fad
5 changed files with 27 additions and 1 deletions

View File

@@ -41,7 +41,12 @@ class ResolverMatch(object):
else:
self.namespaces = []
if not url_name:
url_name = '.'.join([ func.__module__, func.__name__ ])
if not hasattr(func, '__name__'):
# An instance of a callable class
url_name = '.'.join([func.__class__.__module__, func.__class__.__name__])
else:
# A function
url_name = '.'.join([func.__module__, func.__name__])
self.url_name = url_name
def namespace(self):