summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-08-07 07:39:19 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-08-07 07:39:19 +0000
commite990a2cbc43e5eaa3f245cd1b6a4c6850e31f3e9 (patch)
tree10b024d208b80ab26030c924570a402f826f4164
parent8b70c75ed6a11b3f0e55996200addab3f116c145 (diff)
[1.2.X] 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.
Backport of r13540 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13541 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