Improve dictionary (dict()) support in QuerySets
|Reported by:||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 9 years ago by
|Summary:||I love dictionaries → Improve dictionary (dict()) support in QuerySets|