No, it doesn't use unique_together to do the joins, but
unique_together will enforce the uniqueness constraint of the compound
key, and allow you to do a lookup of an object based on the compound
key.
As Bruno explained, you'll have to use for surrogate primary keys the
auto-generated integer prim
On 28 juin, 19:27, thusjanthan 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 !-)
OT
Yes you are correct I am looking to implement the compounded primary
keys. 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
By definition a database table can have only one primary key. I
believe what you're looking to implement are compound primary keys.
Depending on the database backend you're using, the unique_together
Meta attribute may accomplish most of what you're looking to do.
On Jun 28, 12:49 pm, thusjantha
Can anyone tell me why django refuses to follow the rules and lesson
we learn in our database courses?
I have a table that I do not have control over. Suppose its called the
phone table and it contains the number and the username as the primary
key. But for some reason when I have more than one pr
5 matches
Mail list logo