On Sat, Aug 1, 2009 at 12:05 PM, Daniele Procida<[email protected]> wrote: > > I am trying to set up a model. > > A Person has a ManyToMany relationship with Entities. One of those > relationships is special - we can capture that with a ForeignKey > relationship to Entity. > > But, I want to limit the choices for that special relationship to > Entities that the person already has a relationship with, by using a: >
If you need this for the admin app and are using Django 1.1 read about the formfield_for_foreignkey ModelAdmin method: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_foreignkey you can write your own and further filter the queryset used for the FK field UI there, an example is included in the documentation. HTH -- Ramiro Morales http://rmorales.net PyCon 2009 Argentina - Vie 4 y Sab 5 Setiembre Buenos Aires, Argentina http://ar.pycon.org/2009/about/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

