Opened 13 years ago

Closed 13 years ago

#2783 closed defect (fixed)

[patch] Small patch to make One to One fields work with any data type

Reported by: Joel Heenan <joelh-django@…> Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Django appears to assume that a one to one field will be referrencing an integer and breaks if it is not. This small patch means that tables are created with the same data type as to that which they are referrencing.

Attachments (1)

one_to_one_db_column.diff (608 bytes) - added by Joel Heenan <joelh-django@… 13 years ago.

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by Joel Heenan <joelh-django@…

Attachment: one_to_one_db_column.diff added

comment:1 Changed 13 years ago by Malcolm Tredinnick

This looks correct, but it needs a test before it can be committed.

comment:2 Changed 13 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [3846]) Fixed #2783 -- Fixed one-to-one fields to work with any primary key data type
in the related model. Thanks, Joel Heenan.

Note: See TracTickets for help on using tickets.
Back to Top