On 3 nov, 09:09, Low Kian Seong <django....@gmail.com> wrote:
> But I am confused here. How do iterate through the data another time?
> Do I call the select_related in my views.py code like:
>
> manager_info = found_entries.select_related()
>
> then how do i iterate through manager_info in my template?

That's not how it works. The only thing you have to do is to
call .select_related on your queryset - it will take care of
generating a SQL request that follows the relationships. You have
nothing else to do in your template.

ie, in your view:

  objects = MyModel.filter(...).select_related()

And of course, *don't* use len(objects).

http://docs.djangoproject.com/en/dev/ref/models/querysets/#id1

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