So values() and values_list return these subclassed dicts and tuples, which lazily construct and return the relevant M2M or reverse foreign key elements when they are accessed.In the end, the subclassed dict and tuple would work somewhat like the Django model, except that you access things in the form of dictionaries and tuples, and you limit the elements that can appear in them.
--
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-develop...@googlegroups.com.
To post to this group, send email to django-d...@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/4c1b12a4-822a-4582-8d57-3a8f04f62a58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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.
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.