diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2008-12-03 15:45:19 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2008-12-03 15:45:19 +0000 |
| commit | a44d0aace33f08f3fb0a0eb7bd45a32d8366940e (patch) | |
| tree | 91a148a83b33c1a1d2dbec2d2d8d69c7b21e6249 | |
| parent | 9c33d74f1dbc71dc295f11c1be2f1146a487e611 (diff) | |
Refs #8248 - GenericRelations descriptors now return self when accessed via class
These were missed in r9550
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9562 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/contenttypes/generic.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/contrib/contenttypes/generic.py b/django/contrib/contenttypes/generic.py index 0504592ebb..c294f74500 100644 --- a/django/contrib/contenttypes/generic.py +++ b/django/contrib/contenttypes/generic.py @@ -59,7 +59,7 @@ class GenericForeignKey(object): 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 @@ class ReverseGenericRelatedObjectsDescriptor(object): 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 |
