top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is difference between values vs values_list in Django filter object ?

0 votes
34 views
What is difference between values vs values_list in Django filter object ?
posted Jan 30 by anonymous

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

The values() method returns a QuerySet containing dictionaries:

<QuerySet [{'comment_id': 1}, {'comment_id': 2}]>

The values_list() method returns a QuerySet containing tuples:

<QuerySet [(1,), (2,)]>

If you are using values_list() with a single field, you can use flat=True to return a QuerySet of single values instead of 1-tuples:

<QuerySet [1, 2]>
answer Jan 31 by Aarati Mahajan
Similar Questions
0 votes

I'm new to Django. Is there any tell how to add a limit filter in Django?

+2 votes

Depending on the packet filter, it is decided to which bearer does the incoming packet belongs to. If TFT does this job, then what is the use of Pcc-Rule ?

Is it that Pcc-Rules are not matched in case of dedicated bearers as in dedicated bearer packet filter are already matched ?
Is it that DPI is done only for default bearer packets and decided to which pcc-rule is belongs to ?

Please help with reference to spec...

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...