Thanks for the responses, and yeah Maciej is correct the m2m
relationship works fine without any errors, it's just that I can only
edit the prey relationship (as Maciej text art does a much better job
of showing than my explanation).

Right now if I add say a "rabbit" I'd have to go to edit every other
animal that is a predator of the rabbit to specify that the rabbit is
prey for those other animals vs just selecting the predators on the
rabbit edit page. Which is obviously less than ideal.

When I try adding a predator field so I have this in my model:
prey = models.ManyToManyField("self", related_name="predator",
symmetrical=False)
predator = models.ManyToManyField("self", related_name="prey",
symmetrical=False)

Then it gives the following errors:
Validating models...
animals.animal: Accessor for m2m field 'prey' clashes with m2m field
'Animal.predator'. Add a related_name argument to the definition for
'prey'.
animals.animal: Reverse query name for m2m field 'prey' clashes with
m2m field 'Animal.predator'. Add a related_name argument to the
definition for 'prey'.
animals.animal: Accessor for m2m field 'predator' clashes with m2m
field 'Animal.prey'. Add a related_name argument to the definition for
'predator'.
animals.animal: Reverse query name for m2m field 'predator' clashes
with m2m field 'Animal.prey'. Add a related_name argument to the
definition for 'predator'.


If this is something the admin interface can't do then any pointers on
how to customize it or where to look for more information would be
great.

Thanks,
--James


On 8/21/06, Maciej Bliziñski <[EMAIL PROTECTED]> wrote:
>
> On Mon, 2006-08-21 at 08:12 +0800, Russell Keith-Magee wrote:
> >         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?
> >
> > It should be possible. The m2m_recursive modeltests should give an
> > example of what you can do.
> >
> > To help diagnose your problem - what exactly is failing? Where error
> > message are you getting?
>
> I think there is no error message. If I understood James correctly, the
> animal edit form displays a list of preys of currently edited animal,
> while James would like to edit both sets: preys and predators.
>
> More graphically, James sees:
>
> ---------------------------
> Editing Animal
> Animal name: Frog
> ...
> Preys:
> [v] Fly
> [v] Mosquito
> [ ] Stork
> ---------------------------
>
> While he wants to see:
>
> ---------------------------
> Editing Animal
> Animal name: Frog
> ...
> Preys:
> [v] Fly
> [v] Mosquito
> [ ] Stork
>
> Predators:
> [ ] Fly
> [ ] Mosquito
> [v] Stork
> ---------------------------
>
>
> --
> Maciej Bliziñski
> http://automatthias.wordpress.com
>
>
> >
>

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