I have an animal class that with a predator and prey relationship to
itself. Each animal can have many other animals that are their
predator and many other animals that are their prey. The appropriate
part of the model is below.

class Animal(models.Model):
  name = models.CharField(maxlength=200)
  prey = models.ManyToManyField("self", related_name="predator",
symmetrical=False, filter_interface=models.HORIZONTAL)

And it works as expected except I can only edit the "prey" part of the
relationship. Ideally I'd like to be able to specify both predator and
prey when adding or editing an animal. Is that possible to do?

I tried adding this field, but it complains about conflicting with the
prey relationship.
predator = models.ManyToManyField("self", related_name="prey",
symmetrical=False, filter_interface=models.HORIZONTAL)

Any help/thoughts would be appreciated.

Thanks,
--James

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

Reply via email to