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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user