Hey all,

I guess I'm lazy with sql queries, so I've got a quick question.  I
just pulled a set of results from a table that foreign_keys the User
table.

But at the same time I'd like to access the get_profile data for each
one of the users.

I know that if you do:
print e.blog #hits the database
print e.blog #will used the cached version

What if I do the following
members = Access.objects.select_related().filter(xxx) #should grab all
the associated user data here (but not the profile data)

And then in the template I do the following:

{% for member in members %}
{{member.user.get_profile().gender}} # should hit the db right?
{{member.user.get_profile().weight}} # will this hit the db again? or
will it use a cached version?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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