diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py index 8e2af52464d..c512c37b962 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):