Author: jacob
Date: 2008-08-27 17:51:24 -0500 (Wed, 27 Aug 2008)
New Revision: 8641

Modified:
   django/trunk/django/contrib/comments/templatetags/comments.py
Log:
Fixed #8544: correctly cast `Comment.object_pk` to string when doing lookups. 
This really only papers over a bigger problem related to casting the RHS of 
GFKs, but that larger change can wait for a more systematic fix.

Modified: django/trunk/django/contrib/comments/templatetags/comments.py
===================================================================
--- django/trunk/django/contrib/comments/templatetags/comments.py       
2008-08-27 22:21:14 UTC (rev 8640)
+++ django/trunk/django/contrib/comments/templatetags/comments.py       
2008-08-27 22:51:24 UTC (rev 8641)
@@ -3,6 +3,7 @@
 from django.conf import settings
 from django.contrib.contenttypes.models import ContentType
 from django.contrib import comments
+from django.utils.encoding import smart_unicode
 
 register = template.Library()
 
@@ -77,7 +78,7 @@
 
         qs = self.comment_model.objects.filter(
             content_type = ctype,
-            object_pk    = object_pk,
+            object_pk    = smart_unicode(object_pk),
             site__pk     = settings.SITE_ID,
             is_public    = True,
         )


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to