Code

Opened 8 years ago

Closed 8 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
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: UI/UX:

Description

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@… 8 years ago.

Download all attachments as: .zip

Change History (3)

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

comment:1 Changed 8 years ago by mtredinnick

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

comment:2 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.