From e990a2cbc43e5eaa3f245cd1b6a4c6850e31f3e9 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 7 Aug 2010 07:39:19 +0000 Subject: [PATCH] [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 --- django/db/models/fields/__init__.py | 3 +++ 1 file changed, 3 insertions(+) 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