In model B.. if you say
modela = models.ForeignKey(ModelA)

You could also say b.modela_set.all()

On Aug 2, 8:18 pm, Lucky B <[EMAIL PROTECTED]> wrote:
> If I gather correctly you want to see every ModelA that's bound to a
> particular ModelB b?
>
> ModelA.objects.filter(modelBs=b)
>
> That gives you what you want.
>
> On Aug 2, 7:20 pm, Benjamin Goldenberg <[EMAIL PROTECTED]> wrote:
>
> > Hi everyone,
> > I asked about this earlier today on IRC and no one knew of a way to do
> > it. Basically I have a model, let's call it ModelA with a ForeignKey
> > to an instance of ModelB. I would like QuerySet of all instances of
> > ModelB that are bound to that particular ForeignKey. Does anyone have
> > any idea of how to construct such a query?
>
> > Thanks,
> > Benjamin


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