Re: multiple column primary key

2009-06-03 Thread Jaime Casanova
On Wed, Jun 3, 2009 at 9:09 PM, Brian May wrote: > > Having composite pks can have a gotcha. For example, in my mysql based > database, my legacy application had the primary key (from memory) in a table > of > (photo_id,album_id) - this was a table linking photos and albums together. > However

Re: multiple column primary key

2009-06-03 Thread Brian May
On Wed, Jun 03, 2009 at 03:47:18PM -0500, Jaime Casanova wrote: > > Django does not currently support multiple column primary keys, see: > > http://code.djangoproject.com/ticket/373 At the very least django should complain loudly when you try this. I didn't realize my database (from a legacy sche

Re: multiple column primary key

2009-06-03 Thread Jaime Casanova
On Wed, Jun 3, 2009 at 8:13 AM, Alex Gaynor wrote: >so the question is: if i don't define a pk for an >> existing table, there will be problems in the application? for example >> when deciding if a save() should be an insert or an update? >> > > Django does not currently support multiple column p

Re: multiple column primary key

2009-06-03 Thread Mike Driscoll
Jaime, On Jun 3, 1:06 am, Jaime Casanova wrote: > Hi, > > I have an existing database, and want to create an application using > django to administer it... > I am creating the model classes but there are tables with more than > one field in the pk. so the question is: if i don't define a pk for

Re: multiple column primary key

2009-06-03 Thread Alex Gaynor
On Wed, Jun 3, 2009 at 1:06 AM, Jaime Casanova wrote: > > Hi, > > I have an existing database, and want to create an application using > django to administer it... > I am creating the model classes but there are tables with more than > one field in the pk. so the question is: if i don't define a

multiple column primary key

2009-06-03 Thread Jaime Casanova
Hi, I have an existing database, and want to create an application using django to administer it... I am creating the model classes but there are tables with more than one field in the pk. so the question is: if i don't define a pk for an existing table, there will be problems in the application?