Add support for multiple-column primary keys
|Reported by:||Jacob||Owned by:||Michal Petrucha|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||onelson@…, stava@…, erik.engbrecht@…, knyght+django@…, Marinho Brandão, Maciej Bliziński, David Larlet, artagnon, Tobu, tristan@…, blyth, vvinet, Joey Wilhelm, stef@…, wprins, jfishman, alexis_m, Wonlay, joejasinski, hector@…, Martin Paquette, vinilios, broderboy, chouquette, spaceriqui, Marco Bazzani, alexlewin, timbo, Mikhail Korobov, Mike Fogel, lau@…, rupa108, ludo@…, scott.hebert@…, rogelio.dominguez@…, drdee, davidhalter88@…, Chris Streeter, gezuru@…, andrewford55139@…, garen.p@…, Sergiy Kuzmenko, pawel.suwala@…, cuboci, Ben Finney, kitsunde@…, kkumler, thisgenericname@…, lars@…, trbs@…, cmawebsite@…, Aron Podrigal, Natt Piyapramote, toracle@…, zerks0@…||Triage Stage:||Accepted|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In the interest of being able to use Django as an admin interface for any db schema, it really should support multiple column primary keys.
Currently, you can "fake" it by declaring one of the keys to be primary in Django and adding a unique constraint to the model. You'd have to do without the auto-generated SQL that Django gives you, but if you're smart enough to know how and why to use multiple primary keys, you can probably write the schema by hand. Still, this is less than ideal.
This is likely to be very difficult.
Change History (132)
comment:12 Changed 11 years ago by
|Summary:||Django lacks support for multiple-column primary keys → Add support for multiple-column primary keys|
comment:19 Changed 10 years ago by
|Owner:||changed from nobody to David Cramer|
|Status:||reopened → new|
comment:80 Changed 6 years ago by
|Owner:||changed from David Cramer to Michal Petrucha|
|Status:||assigned → new|