On Wed, May 6, 2009 at 8:48 PM, jrs_66 <jrs...@yahoo.com> wrote:
>
> Hi,
>
> I have 2 models...
>
[skip]
>
> e = FlattenedCategory.objects.select_related('category').filter
> (member_of_category=15)
>
> which works... This, however, doesn't....
>
> e = e.category
>
> How do I access the related records from the Category model?

This this QuerySet it is simple:

     categories = [fcategory.category for fcategory in e]

or fetch only categories right away:

     categories =
Category.objects.filter(flattenedcategory__member_of_category=15).distinct()

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