Re: Changing the value of the primary key

2008-07-18 Thread J Meier
On Jul 18, 7:41 am, Torsten Bronger <[EMAIL PROTECTED]> wrote: > > Can I ask why you would need to change PKs? > > Yes. We are a scientific institution, and I create a samples > database. Frequently a sample gets a new name, however, the old > name(s) must be kept as aliases. > > For the alias

Re: Changing the value of the primary key

2008-07-18 Thread Torsten Bronger
Hallöchen! Dan writes: > [...] > > I don't think it's best practice to give meaningful names to > primary key field in Django, you should probably have field name > and let Django auto-create a id field. You're right. I now also think that Django's abstraction layer for the RDBMS -- albeit thi

Re: Changing the value of the primary key

2008-07-18 Thread Dan
> > > Are you saying that Django adds the "ON UPDATE CASCADE" to the database > definition? I've never noticed it doing this (unless you're using a > patch that I submitted that does this for Foreign Keys where tell it to > do so). > > Or, are you saying that Django emulates this behavior? I don't

Re: Changing the value of the primary key

2008-07-18 Thread Michael Glassford
Torsten Bronger wrote: > Hallöchen! > > Dan writes: > >> Django sets this for you if your database supports it (ie: you are >> using postgres or mysql with innodb tables). >If you are using >> mysql, check that tables aren't MyISAM. Are you saying that Django adds the "ON UPDATE CASCADE" to the

Re: Changing the value of the primary key

2008-07-18 Thread Torsten Bronger
Hallöchen! Dan writes: > Django sets this for you if your database supports it (ie: you are > using postgres or mysql with innodb tables). If you are using > mysql, check that tables aren't MyISAM. Okay, I have InnoDB. > If you want to do this inside Django, more complex because if you > chang

Re: Changing the value of the primary key

2008-07-18 Thread Dan
Django sets this for you if your database supports it (ie: you are using postgres or mysql with innodb tables). If you are using mysql, check that tables aren't MyISAM. If you want to do this inside Django, more complex because if you change an object's primary key, Django concludes that you want t

Changing the value of the primary key

2008-07-18 Thread Torsten Bronger
Hallöchen! When I change the value of a primary key field (assuming that it is still unique), are depending tables also updated? I found on the net that "ON UPDATE CASCADE" has to be set for the child tables, but I didn't find anything Django-related. Tschö, Torsten. -- Torsten Bronger, aquis