1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #2164 -- Create correct SQL when pk column name is not the same as the

attribute name. Thanks, Russell Cloran.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2006-06-15 11:28:28 +00:00
parent 8938d5eeb3
commit 28e643743f
2 changed files with 3 additions and 2 deletions

View File

@@ -8,7 +8,8 @@ this behavior by explicitly adding ``primary_key=True`` to a field.
from django.db import models
class Employee(models.Model):
employee_code = models.CharField(maxlength=10, primary_key=True)
employee_code = models.CharField(maxlength=10, primary_key=True,
db_column = 'code')
first_name = models.CharField(maxlength=20)
last_name = models.CharField(maxlength=20)
class Meta: