I dont think they do.

The only time i use raw sql + joins is for performance... eg:

When you have a model and for each instance of that model it has a
reverse foreignkey relationship where you would have to call:
<related_model_name>_set.all()
in a for loop thus making heaps of sql queries.

There are 3rd party addons for that:
http://code.google.com/p/django-selectreverse/
Does a good job of avoiding the n+1 problem for most situations.

Hope this helps

cheers

sam.




On Wed, Aug 11, 2010 at 4:36 PM, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Aug 11, 2:28 am, Phlip <phlip2...@gmail.com> wrote:
>> >  orders = Order.objects.filter(
>> >    pk=42,
>> >    order_items__product='whiteboards'
>> >    )
>>
>> > Is this not what you want?
>>
>> We made a feeb attempt at that and gave up. Thanks! I will try it next.
>>
>> The next question, if it works, will be how to values_list() a field
>> from a child record; it might follow that notation.
>>
>> Could I trouble you for its home page? Googling for [django queryset
>> join] gives zillions of newbs trying simple queries...
>
> http://docs.djangoproject.com/en/1.2/topics/db/queries/#lookups-that-span-relationships
>
> --
> 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-us...@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.
>
>

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