Ticket #4839: urlresolvers_repr.diff

File urlresolvers_repr.diff, 978 bytes (added by Thomas Güttler <hv@…>, 12 years ago)
  • django/core/urlresolvers.py

     
    144144        self.default_args = default_args or {}
    145145        self.name = name
    146146
     147    def __repr__(self):
     148        return '<%s %s %s>' % (
     149            self.__class__.__name__, self.name, self.regex.pattern)
     150   
     151
    147152    def add_prefix(self, prefix):
    148153        """
    149154        Adds the prefix string to a string-based callback.
     
    205210        self.default_kwargs = default_kwargs or {}
    206211        self._reverse_dict = {}
    207212
     213    def __repr__(self):
     214        return '<%s %s %s>' % (
     215            self.__class__.__name__, self.urlconf_name, self.regex.pattern)
     216   
     217
    208218    def _get_reverse_dict(self):
    209219        if not self._reverse_dict and hasattr(self.urlconf_module, 'urlpatterns'):
    210220            for pattern in reversed(self.urlconf_module.urlpatterns):
Back to Top