Improve dictionary (dict()) support in QuerySets
|Reported by:||wim@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Being a happy-dictionary-user I would love it if Django gave them more support. Two opportunities spring into mind:
- Model.objects.filter(id=1).values() does not support many-to-many fields. I feel like it should do so and return their ids as a list, like in: 'key': [1, 2, 3] . Because many-to-many fields are in the declaration of the model, and in the .filter()-results, I believe they should be represented in the .values()-dictionary as well.
- I really miss .values() in Model.objects.get(id=1), which to me seems asymmetric.
Thanks for giving this a thought. For me, dictionaries and lists are a very friendly and native way of handling data in Python. They can easily represent complex data structures while staying comprehensible. I hope they make you happy too.
Change History (5)
comment:1 Changed 7 years ago by telenieko
- milestone set to post-1.0
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Summary changed from I love dictionaries to Improve dictionary (dict()) support in QuerySets
comment:3 Changed 7 years ago by mtredinnick
- Resolution set to duplicate
- Status changed from new to closed