Hi all,

got it:

destination = models.ManyToManyField(Destination, related_name="Destinations", limit_choices_to={'metadata_destination':True})
destination_metadata = models.ManyToManyField(Destination, related_name="MetadataDestinations", limit_choices_to={'metadata_destination':False})

Sorry for any trouble,

chris

On 4/24/06, Christian Schneider <[EMAIL PROTECTED]> wrote:
Hi all,

I've got a model with the fields

destination = models.ManyToManyField(Destination, related_name="Destinations")
destination_metadata = models.ManyToManyField(Destination, related_name="MetadataDestinations")

that is both destination and destination_metadata are related to the same table. They are, however, mutually exclusive in that the model "Destination" contains a BooleanField that specifies which instance of the model should go in the destination relation and which should go into the destination_metadata relation.

While that seems to work in principle, the form interface contains for both keys all values of type destination. Is there a way to specify in the model that only certain values should be included in the ManyToManyField-list? That is I'd like to say something like

destination = models.ManyToManyField(Destination, related_name="Destinations", is_medata=False)
destination_metadata = models.ManyToManyField(Destination, related_name="MetadataDestination, is_metadata=True)


Thanks and regards

chris


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

Reply via email to