Author: lukeplant
Date: 2008-12-03 09:45:19 -0600 (Wed, 03 Dec 2008)
New Revision: 9562

Modified:
   django/trunk/django/contrib/contenttypes/generic.py
Log:
Refs #8248 - GenericRelations descriptors now return self when accessed via 
class

These were missed in r9550 


Modified: django/trunk/django/contrib/contenttypes/generic.py
===================================================================
--- django/trunk/django/contrib/contenttypes/generic.py 2008-12-03 13:23:23 UTC 
(rev 9561)
+++ django/trunk/django/contrib/contenttypes/generic.py 2008-12-03 15:45:19 UTC 
(rev 9562)
@@ -59,7 +59,7 @@
 
     def __get__(self, instance, instance_type=None):
         if instance is None:
-            raise AttributeError, u"%s must be accessed via instance" % 
self.name
+            return self
 
         try:
             return getattr(instance, self.cache_attr)
@@ -183,7 +183,7 @@
 
     def __get__(self, instance, instance_type=None):
         if instance is None:
-            raise AttributeError, "Manager must be accessed via instance"
+            return self
 
         # This import is done here to avoid circular import importing this 
module
         from django.contrib.contenttypes.models import ContentType


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