summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-08-07 07:38:27 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-08-07 07:38:27 +0000
commit244e7b9334beb6d61814b849445a128aa0ce3c9e (patch)
tree1a22153b08635e2a44788eaf1d9f65e717a10e7f
parent72dc12ed06ae45e49c79b8fd257e1b1589b3fad2 (diff)
Fixed #13516 -- Added an internal type definition for AutoFields, so that subclassed fields are handled correctly by the SQL generator. Thanks to manfre for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13540 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/fields/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
index 4640eb3238..3c58873035 100644
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -459,6 +459,9 @@ class AutoField(Field):
kwargs['blank'] = True
Field.__init__(self, *args, **kwargs)
+ def get_internal_type(self):
+ return "AutoField"
+
def to_python(self, value):
if value is None:
return value