Skip to content
Advertisement

How to get QuerySet values separately?

How I can to get values from QuerySet separately? The result of my QuerySet now is <QuertSet[<value: 5>, <value:90>]> How I can get 5, 90 to separate variable ?

Advertisement

Answer

There are many ways you can acheive it. For example:

JavaScript

or using values_list():

JavaScript

If you want the first two values of a queryset, then do this:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement