Hockey127 Hockey127 - 1 year ago 103
Python Question

Force evaluate a lazy query

Is there a way to evaluate the following expression?

instances = Catalog.objects.filter(q)

I am trying to profile it, but since it is lazy, it won't actually do the evaluation until it returns it. I was thinking
), is there anything else?

Answer Source

Here are all the ways to evaluate a lazy queryset. Using list is one of them:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download