On 28 juin, 19:27, thusjanthan <thusjant...@gmail.com> wrote: > Yes you are correct I am looking to implement the compounded primary > keys.
It's a fact that Django's ORM doesn't support compound primary keys so far. It's a bit of a shortcoming, but the good news is that it's a FOSS project so YOU can contribute !-) OTHO - and while I tend to dislike them - having surrogate keys all of the same type sometimes help with genericity and reusability. Things like the ContentType framework just couldn't work without. > Well the problem is I would like to have a many to many(m2m) > with two models that share a compounded primary key. However when I do > the m2m join it randomly pics one of the compounded keys and tries to > join them? :| > Does the unique_together parameter fix that problem? > as > in does it use the unique_together to do the joins? unique_together creates compound indexes with a unicity contraint. That's all. IOW, it won't be used to "do the joins". Now nothing prevents you to do the join by yourself, but since you'll still need a surrogate primary key chances are this will just be a waste of time. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.