Hi, all:

Recently, I linked two models ( FOO & BAR ) with a foreign key.
Then I retrieved the whole records back with the following codes:

1 for item in FOO.objects.all():
2   print item.bar.id

In my opinion, the whole thing should be lazy enough.
So if Line 1 got all the BAR id back, *WHY* did Line 2 still trigger a
SQL query to retrieve the whole BAR object while all I want here was
just that ID, which, I think, was already known by django at this
time?
Am I missing something here?

Thanks.

-- 
Regards.
-Tian

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