Yes, but I thinks this will not load blog objects that do not have
entries.


Vassil

On Nov 10, 12:17 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Nov 10, 7:18 am, vmihaylov <[EMAIL PROTECTED]> wrote:
>
> > Hello everyone,
> > I need to eager load an object along with any backward relationships
> > it has.
> > But I can't figure out how to do it.
> > Lets consider the example 
> > fromhttp://docs.djangoproject.com/en/dev/topics/db/queries/
> > What I want is to load a blog object and then access its entries even
> > if they are null, without hitting the database again.
> > Is this possible at all?
>
> > Thanks,
> > Vassil
>
> You can't do it directly. The best thing to do is turn the query
> around:
>
> Entry.objects.select_related().filter(blog__pk=myblogid)
>
> --
> DR.
--~--~---------~--~----~------------~-------~--~----~
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