Resources
Answers
Examples
Sign in
Get Started
What do you want to save?
Add Code snippet
New code examples
Python
2021-11-19 16:32:20
get a list of ids from queryset django
author = Blog.objects.filter(author=author) ids = author.values_list('pk', flat=True) # list method get ids without parse the returning queryset print(list(ids))
Add solution
Python
2021-11-10 17:45:12
django only certain columns from database
Entry.objects.values_list('id', 'headline')
Add solution
Python
2021-10-24 07:55:16
what is values_list in django orm
Test.objects.all() time: 0.010061947107315063 Test.objects.all().values('first') time: 0.00578328013420105 Test.objects.all().values_list('first') time: 0.005257354974746704 Test.objects.al...
Add solution
Python
2021-10-13 04:25:07
django command to fetch all columns of a table
table = Country.objects.values_list('name_of_the_country', 'country_code')
Add solution
Other
2021-09-14 23:11:02
Django values_list
Test.objects.all() time: 0.010061947107315063 Test.objects.all().values('first') time: 0.00578328013420105 Test.objects.all().values_list('first') time: 0.005257354974746704 Test.objects.al...
Add solution
Best helpers
daily
weekly
monthly
for 3 months
Shaples
+5
Tranquilled
+5
Leo Goodstadt
+5
Kozuch
+5
Big D Rock
+5
The 313137
+5
Toby Stewart
+5
Moez
+5
Stelle
+5
Kathrin
+5
Moradnejad
+5
Tony_Henrich
+5
show more
This website uses cookies to make IQCode work for you. By using this site, you agree to our
cookie policy
Welcome Back!
Sign up to unlock all of IQCode features:
Test your skills and track progress
Engage in comprehensive interactive courses
Commit to daily skill-enhancing challenges
Solve practical, real-world issues
Share your insights and learnings
Sign in
E-mail
Password
Recover lost password
Log in
Or log in with
Not registered?
Sign up takes less than a minute
Create a Free Account
Sign up to unlock all of IQCode features:
Test your skills and track progress
Engage in comprehensive interactive courses
Commit to daily skill-enhancing challenges
Solve practical, real-world issues
Share your insights and learnings
Sign up
Email
Password
Sign up for free
Or sign up with
By signing up, you agree to the
Terms and Conditions
and
Privacy Policy
. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.