> values() and values_list() are both intended as optimisations for a 
> specific use case - retrieval of subsets of data without the overhead of 
> creating a model instance. This metaphor completely falls apart when 
> dealing with m2m relations, because the the "one row, one object" metaphor 
> that underpins most of the ORM falls apart. 
>
> I agree with you on this. "one-row,one-object" cannot be implemented here.
 

> While we could search for a deeper meaning for queries of this type, and 
> restructure the internal SQL to account for this, there's another issue to 
> consider. We're also talking about a part of the query API that has existed 
> since at least the query set refactor, and possibly as far back as magic 
> removal. That means there's between 5 and 7 years of legacy here, in which 
> time nobody else has raised a ticket about this issue. It's also reasonable 
> to assume that there will be a non-trivial number of people depending on 
> the API as currently implemented. 
>
> So, I'm inclined to say this is a known wart in the ORM, born of the leaky 
> abstraction of pushing relational data into an object-based representation. 
> Document the limitation, and move on.
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/da7a89f3-25c8-4503-a443-e77c6b609d09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to