Opened 18 years ago

Closed 18 years ago

#958 closed defect (duplicate)

[patch] Allow non-int Primary Keys in ForeignKey

Reported by: Boffbowsh Owned by: Adrian Holovaty
Component: Metasystem Version:
Severity: normal Keywords:
Cc: paul.bowsher@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

{{{Index: /usr/local/django_src/django/core/meta/fields.py
===================================================================
--- /usr/local/django_src/django/core/meta/fields.py (revision 1476)
+++ /usr/local/django_src/django/core/meta/fields.py (working copy)
@@ -722,7 +722,7 @@

if value == or value == None:

return None

else:

  • return int(value)

+ return value

def flatten_data(self, follow, obj = None):

if not obj:}}}

Change History (2)

comment:1 by Boffbowsh, 18 years ago

Index: /usr/local/django_src/django/core/meta/fields.py
===================================================================
--- /usr/local/django_src/django/core/meta/fields.py    (revision 1476)
+++ /usr/local/django_src/django/core/meta/fields.py    (working copy)
@@ -722,7 +722,7 @@
         if value == '' or value == None:
            return None
         else:
-           return int(value)
+           return value
 
     def flatten_data(self, follow, obj = None):
         if not obj:

fs, fixed formatting

comment:2 by L.Plant.98@…, 18 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #927

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