Miss order and choices fields in Django values

30 views
Skip to first unread message

wael muhammed

unread,
Jan 23, 2021, 11:19:53 AM1/23/21
to Django developers (Contributions to Django itself)
Dear Django Developers:
I am a python developer. I have been using a django framework from the past year.
I found that there are some problems in values method and this is the description:

  1. Miss order of fields in querySet if  I make myquery = MyModel.objects.values('field1','field2','field3') when I print QuerySet it give me [{'field2':'data','field1':'data','field3':'data'},...]. so this miss order will cause a problem at Union of queryset
  2.   if the field is choices at model then values(...) will give me the key of a dictionary instead of its value  this is true but if I display the query set to a user in a table .
Reply all
Reply to author
Forward
0 new messages