Author: mtredinnick
Date: 2008-08-27 02:04:58 -0500 (Wed, 27 Aug 2008)
New Revision: 8614
Modified:
django/trunk/django/contrib/comments/models.py
django/trunk/django/contrib/comments/urls.py
Log:
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.
Modified: django/trunk/django/contrib/comments/models.py
===================================================================
--- django/trunk/django/contrib/comments/models.py 2008-08-27 06:02:13 UTC
(rev 8613)
+++ django/trunk/django/contrib/comments/models.py 2008-08-27 07:04:58 UTC
(rev 8614)
@@ -30,11 +30,10 @@
def get_content_object_url(self):
"""
- Get a URL suitable for redirecting to the content object. Uses the
- ``django.views.defaults.shortcut`` view, which thus must be installed.
+ Get a URL suitable for redirecting to the content object.
"""
return urlresolvers.reverse(
- "django.views.defaults.shortcut",
+ "comments-url-redirect",
args=(self.content_type_id, self.object_pk)
)
Modified: django/trunk/django/contrib/comments/urls.py
===================================================================
--- django/trunk/django/contrib/comments/urls.py 2008-08-27 06:02:13 UTC
(rev 8613)
+++ django/trunk/django/contrib/comments/urls.py 2008-08-27 07:04:58 UTC
(rev 8614)
@@ -13,3 +13,7 @@
url(r'^approved/$', 'moderation.approve_done',
name='comments-approve-done'),
)
+urlpatterns += patterns('',
+ url(r'^cr/(\d+)/(\w+)/$', 'django.views.defaults.shortcut',
name='comments-url-redirect'),
+)
+
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---