Permalink
Browse files

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...
1 parent 9c33d74 commit a44d0aace33f08f3fb0a0eb7bd45a32d8366940e @spookylukey spookylukey committed Dec 3, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/contrib/contenttypes/generic.py
View
4 django/contrib/contenttypes/generic.py
@@ -59,7 +59,7 @@ def get_content_type(self, obj=None, id=None):
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 __init__(self, field):
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

0 comments on commit a44d0aa

Please sign in to comment.