Skip to content

Commit

Permalink
[1.2.X] Fixed #13516 -- Added an internal type definition for AutoFie…
Browse files Browse the repository at this point in the history
…lds, 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
  • Loading branch information
freakboy3742 committed Aug 7, 2010
1 parent 8b70c75 commit e990a2c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions django/db/models/fields/__init__.py
Expand Up @@ -459,6 +459,9 @@ def __init__(self, *args, **kwargs):
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
Expand Down

0 comments on commit e990a2c

Please sign in to comment.