Thanks for the suggestion, but I do that and I still see the same problem.
 This is pretty weird to me, because it seems like this should work, and I'm
pretty sure I've done this in other projects and it worked just fine.  I
have no idea why it's not working now.

On Sat, Jul 2, 2011 at 7:42 PM, Javier Guerra Giraldez
<jav...@guerrag.com>wrote:

> On Sat, Jul 2, 2011 at 8:07 AM, Matthew Gardner <mj...@byu.edu> wrote:
> > a = A.objects.get(pk=some_id)
> > b_set = a.b_set.select_related().all() # recommended in the Django
> > documentation for some queries
> > And b_set comes up empty, for some reason that I can't explain.
>
>
> a.b_set  isn't a QuerySet; it's a RelatedManager.  For most uses, it's
> almost the same; but not exactly.  try reversing the select_related()
> and all() calls (all() returns a QuerySet):
>
> b_set = a.b_set.all().select_related()
>
> --
> Javier
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to