I'm moving data from another database and when I try to populate the
relational table created by django as a result of a ManyToMany field,
I run into a unique constraint error:

------------
duplicate key violates unique constraint
"main_msgpost_users_msgpost_id_key"
------------

msgpost_users is the table, with two columns: msgpost_id and user_id.
This is the model:

-------------
class MsgPost(models.Model):
    thread        = models.ForeignKey(MsgThread)
    user          = models.ForeignKey(User)
    ts            = models.DateTimeField(auto_now=True)
    sub           = models.CharField(maxlength=50)
    body          = models.TextField()
    users         = models.ManyToManyField(User,
related_name="msg_users")
-----------

Why would there be a unique constraint on *either* of the columns in a
ManyToMany rel table (hence "many")? Did I set up something wrong?


--~--~---------~--~----~------------~-------~--~----~
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