1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #2783 -- Fixed one-to-one fields to work with any primary key data type

in the related model. Thanks, Joel Heenan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3846 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2006-09-26 02:58:36 +00:00
parent 1fc62f0fd6
commit 4ed82677be
3 changed files with 16 additions and 1 deletions

View File

@@ -147,7 +147,7 @@ def _get_sql_model_create(model, known_models=set()):
table_output = []
pending_references = {}
for f in opts.fields:
if isinstance(f, models.ForeignKey):
if isinstance(f, (models.ForeignKey, models.OneToOneField)):
rel_field = f.rel.get_related_field()
data_type = get_rel_data_type(rel_field)
else: