Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#7785 closed (fixed)

Add note about the requirement of integer primary keys in generic relations

Reported by: Rudolph Froger Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

For Generic Relations using an integer primary key is a requirement. Non-integer primary keys will not work. I will add a patch to add this note to the docs.

Please also see the discussion on Google Groups.

Attachments (1)

note-about-primary-keys.diff (603 bytes ) - added by Rudolph Froger 16 years ago.
Adds note to docs about field types for primary keys

Download all attachments as: .zip

Change History (6)

by Rudolph Froger, 16 years ago

Adds note to docs about field types for primary keys

comment:1 by charmless, 16 years ago

I've been using non-integer primary keys with my generic relations just fine. In fact, with Postgres 8.2 (but not 8.3), integers are converted to strings, so I can have my relations reference models with both string and integer primary keys. I have no idea about dates. This mixing is a Postgres 8.2-specific 'hack', but there's nothing standing in the way of heterogeneous non-integer primary keys for generic relations.

So I'm a bit confused and worried regarding what this ticket is about.

comment:2 by charmless, 16 years ago

... and then I read the actual patch proposed and was enlightened. Ignore me. (though a method for handling heterogeneous keys, as the psql hack above does, in a general way, might be nice.)

comment:3 by Simon Greenhill, 16 years ago

Has patch: set
milestone: 1.0 beta
Triage Stage: UnreviewedReady for checkin

comment:4 by Russell Keith-Magee, 16 years ago

Resolution: fixed
Status: newclosed

(In [7976]) Fixed #7785 -- Added a note in the contenttypes documentation that GenericRelations must share a common field type for primary keys. Thanks to Rudolph for the suggestion and initial draft.

comment:5 by Jacob, 13 years ago

milestone: 1.0 beta

Milestone 1.0 beta deleted

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