Re: AssertionError on a model

2008-02-06 Thread Rajesh Dhawan
On Feb 6, 8:27 am, Nader <[EMAIL PROTECTED]> wrote: > Thank you for this conceptual remark. > Could the "ForeignKey" filed be a "primary_key at the same time? No. And that's the source of the problem you are seeing. If you just want the ForeignKey to be unique, you can add a unique=True

Re: AssertionError on a model

2008-02-06 Thread Nader
Thank you for this conceptual remark. Could the "ForeignKey" filed be a "primary_key at the same time? datasetID = models.ForeignKey(Dataset, db_column="datasetID", primary_key=True) I suppose I can define a group of fields as "primary_key" by using of the next statement : Class Model(..)

Re: AssertionError on a model

2008-02-06 Thread Pete Crosier
A model can only use one field as its primary key and Distributequeue.objects.get() should only return one object. http://www.djangoproject.com/documentation/model-api/#primary-key http://www.djangoproject.com/documentation/db-api/#get-kwargs Cheers, Pete. On Feb 6, 12:11 pm, Nader <[EMAIL

AssertionError on a model

2008-02-06 Thread Nader
Hallo, I have a model as following: class Distributequeue(models.Model): datasetID = models.ForeignKey(Dataset, db_column="datasetID", primary_key=True) filename = models.CharField(primary_key=True, maxlength=240) fileVersion = models.CharField(primary_key=True, maxlength=48)