S
S
Sergey Ganzhela2018-09-03 18:36:49
Django
Sergey Ganzhela, 2018-09-03 18:36:49

How to output a large number of qs.values() in Django?

People please tell me if it is possible after executing the ORM request, if a large number of elements use values ​​() and get all the values, or do you still need to form the dictionary itself? Or am I a little misunderstanding whether values() itself cuts the number of displayed values ​​or the shell in which I work?
Thanks for understanding!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2018-09-03
@Sergiy_Hanzhela

Cuts the __str__ of the object you receive. All values ​​are in memory. You can make sure:

for dct in Model.objects.values(...):
    print(dct)

Or
len(Model.objects.values(...))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question