Hi, I am using select_related in a loop in order to reduce database hits. 
The weird thing is that I get a different result set when using 
select_related();

This is not the actual code, but a simple example that illustrates the 
problem:

>>> rr = 
> RouteTableRangeProvider.objects.filter(routetablerange__routetable__id=219,routetablerange__numberingrange__id=21366)
> >>> for r in rr:
> ...   print r.provider.id
> ... 
> 5
> 3
> >>> rr = 
> RouteTableRangeProvider.objects.select_related().filter(routetablerange__routetable__id=219,routetablerange__numberingrange__id=21366)
> >>> for r in rr:
> ...   print r.provider.id
> ... 
> 5
> >>>


None of the FK allows null values. Any ideas of what can be going on?

Regards,

-- Pedro



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to