Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-05-02 Thread Nick Arnett
On Sat, May 1, 2010 at 11:13 AM, Continuation wrote: > > On Apr 30, 9:42 pm, Nick Arnett wrote: > > > If you don't have data in the table, just drop it and use > "unique_together" > > in models.py to define your composite key. You'll find that in

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-05-02 Thread johan sommerfeld
I tried this before and I think it was the admin app that broke. Also ser this link http://code.djangoproject.com/wiki/MultipleColumnPrimaryKeys /J On Saturday, May 1, 2010, Continuation wrote: > > On Apr 30, 9:42 pm, Nick Arnett wrote: > >> If you don't have data in the table, just drop it

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-05-01 Thread Continuation
On Apr 30, 9:42 pm, Nick Arnett wrote: > If you don't have data in the table, just drop it and use "unique_together" > in models.py to define your composite key.  You'll find that in the Django > docs.  Then do syncdb and Django will create the table with your composite >

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-30 Thread Nick Arnett
On Wed, Apr 28, 2010 at 8:09 PM, Continuation wrote: > I'm using MySQL with Django. > > MySQL uses clustered index. I have a class AuctionBid for which the > "natural" PK is (user_id, auction_id). > > I'd like to set (user_id, aucton_id) as the PK so that it'll be the >

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-30 Thread Continuation
On Apr 29, 1:56 pm, Leo wrote: > In Django, the best current option I know of is: > > from django.db import models > class AuctionBid(models.Model): > Your response seems to have been cut off. Could you re-post? Thanks. -- You received this message because you are

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-29 Thread Leo
Hi Continuation, In Django, at this time, the best you can do is: class AuctionBid(models.Model): class Meta: unique_together = ( ( ' On Apr 29, 12:09 pm, Continuation wrote: > I'm using MySQL with Django. > > MySQL uses clustered index. I have a class

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-29 Thread Leo
In Django, the best current option I know of is: from django.db import models class AuctionBid(models.Model): On Apr 29, 12:09 pm, Continuation wrote: > I'm using MySQL with Django. > > MySQL uses clustered index. I have a class AuctionBid for which the > "natural"

Re: Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-29 Thread Leo
Hi Continuation, In Django, at this time, the best you can do is: class AuctionBid(models.Model): class On Apr 29, 12:09 pm, Continuation wrote: > I'm using MySQL with Django. > > MySQL uses clustered index. I have a class AuctionBid for which the > "natural" PK is

Is it safe to alter Django generated tables in MySQL to have composite PK?

2010-04-28 Thread Continuation
I'm using MySQL with Django. MySQL uses clustered index. I have a class AuctionBid for which the "natural" PK is (user_id, auction_id). I'd like to set (user_id, aucton_id) as the PK so that it'll be the clustered index. I understand that Django doesn't support composite PK. But what if after