summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-09-18 09:56:05 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2013-09-18 10:03:52 +0300
commit50633e7353694ff54f14b04469be3792f286182f (patch)
treefb667696403c6655e787c494abb899ed813bb608 /django
parent5be56d0e0d8492a41b3d40757a4f2677211a9179 (diff)
Fixed #12568 -- no error when accessing custom field's descriptor
The SubfieldBase's descriptor caused an AttributeError when accessed from the class. Introspection didn't like that. Patch by Trac alias supervacuo.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/fields/subclassing.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/fields/subclassing.py b/django/db/models/fields/subclassing.py
index 591adb7121..2faf56fc00 100644
--- a/django/db/models/fields/subclassing.py
+++ b/django/db/models/fields/subclassing.py
@@ -30,7 +30,7 @@ class Creator(object):
def __get__(self, obj, type=None):
if obj is None:
- raise AttributeError('Can only be accessed via an instance.')
+ return self
return obj.__dict__[self.field.name]
def __set__(self, obj, value):