Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Refs #8248 - GenericRelations descriptors now return self when access…

…ed via class

These were missed in r9550 


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9562 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a44d0aace33f08f3fb0a0eb7bd45a32d8366940e 1 parent 9c33d74
Luke Plant authored December 03, 2008

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/contrib/contenttypes/generic.py
4  django/contrib/contenttypes/generic.py
@@ -59,7 +59,7 @@ def get_content_type(self, obj=None, id=None):
59 59
 
60 60
     def __get__(self, instance, instance_type=None):
61 61
         if instance is None:
62  
-            raise AttributeError, u"%s must be accessed via instance" % self.name
  62
+            return self
63 63
 
64 64
         try:
65 65
             return getattr(instance, self.cache_attr)
@@ -183,7 +183,7 @@ def __init__(self, field):
183 183
 
184 184
     def __get__(self, instance, instance_type=None):
185 185
         if instance is None:
186  
-            raise AttributeError, "Manager must be accessed via instance"
  186
+            return self
187 187
 
188 188
         # This import is done here to avoid circular import importing this module
189 189
         from django.contrib.contenttypes.models import ContentType

0 notes on commit a44d0aa

Please sign in to comment.
Something went wrong with that request. Please try again.