From 53e3f76d6ec5c450ab2d711368e0dd72bc39dfec Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 13 Jul 2007 09:14:51 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20#4839=20--=20Added=20=5F=5Frepr=5F=5F?= =?UTF-8?q?=20methods=20to=20URL=20classes=20that=20show=20the=20pattern?= =?UTF-8?q?=20they=20contain.=20Thanks,=20Thomas=20G=C3=BCttler.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://code.djangoproject.com/svn/django/trunk@5681 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/urlresolvers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py index 8e2af52464..c512c37b96 100644 --- a/django/core/urlresolvers.py +++ b/django/core/urlresolvers.py @@ -144,6 +144,9 @@ class RegexURLPattern(object): self.default_args = default_args or {} self.name = name + def __repr__(self): + return '<%s %s %s>' % (self.__class__.__name__, self.name, self.regex.pattern) + def add_prefix(self, prefix): """ Adds the prefix string to a string-based callback. @@ -205,6 +208,9 @@ class RegexURLResolver(object): self.default_kwargs = default_kwargs or {} self._reverse_dict = {} + def __repr__(self): + return '<%s %s %s>' % (self.__class__.__name__, self.urlconf_name, self.regex.pattern) + def _get_reverse_dict(self): if not self._reverse_dict and hasattr(self.urlconf_module, 'urlpatterns'): for pattern in reversed(self.urlconf_module.urlpatterns):