Django's model_to_dict(...) should return ALL fields, including hidden

137 views
Skip to first unread message

Anton Danilchenko

unread,
Aug 7, 2015, 8:01:41 AM8/7/15
to Django developers (Contributions to Django itself)
Hello Django users and developers!

I found that Django's function model_to_dict() is useful in some cases. For example, I can transform any Django ORM object to a Python's dict.

But the problem that I found - that I can't grab all Model fields, because model_to_dict() return only fields that aren't hidden. And I decided to add one extra argument to this function that allow us to get ALL fields, including hidden ones.

I named this argument - include_hidden=True - but guys from Django core team found this naming as not well. Please help us to find the best name for this additional argument.

Please find these two tickets - on djangoproject.com and on github.com

Thank you!
Anton

Tim Graham

unread,
Aug 7, 2015, 8:20:56 AM8/7/15
to Django developers (Contributions to Django itself)
As mentioned on the ticket, I think this discussion should first be about whether or not this function should be a public API. Could you please describe your use case?
Reply all
Reply to author
Forward
0 new messages