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 attribute
on it instead of primary_key=True.

>  I suppose I can define a group of fields as "primary_key" by using of
> the next statement :
>
>   unique_together = (("datasetID", "filename", "fileVersion"),)

Yes, use unique_together to declare that a group of fields are
together a set of unique values. But let Django create an id field as
an implicit primary key to keep things simple (or define another field
as the PK that's not a ForeignKey or ManyToMany etc.)

-Rajesh D.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to