Django

Code

Changeset 8614

Show
Ignore:
Timestamp:
08/27/08 02:04:58 (3 months ago)
Author:
mtredinnick
Message:

Fixed get_absolute_url() for comments. Previously, it relied on "view on site"
for admin being reversible or required people to set up their own version. Now
we ship a default pattern in the comments URLs in a way that is unlikely to
clash with anything else.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/comments/models.py

    r8557 r8614  
    3131    def get_content_object_url(self): 
    3232        """ 
    33         Get a URL suitable for redirecting to the content object. Uses the 
    34         ``django.views.defaults.shortcut`` view, which thus must be installed. 
     33        Get a URL suitable for redirecting to the content object. 
    3534        """ 
    3635        return urlresolvers.reverse( 
    37             "django.views.defaults.shortcut", 
     36            "comments-url-redirect", 
    3837            args=(self.content_type_id, self.object_pk) 
    3938        ) 
  • django/trunk/django/contrib/comments/urls.py

    r8557 r8614  
    1414) 
    1515 
     16urlpatterns += patterns('', 
     17    url(r'^cr/(\d+)/(\w+)/$', 'django.views.defaults.shortcut', name='comments-url-redirect'), 
     18) 
     19