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, thusjanthan <[email protected]> wrote: > 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 primary key in > django it complains. Especially when I run the test suite it just > craps out saying more than one primary key detected for a model. Does > django really expect all tables to only contain one primary key? How > can I override this feature and have it take more than one primary key > without using things suggested by django about the unique attr in the > meta info of the model. > > Thanks. > Nathan. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. 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.

