V
V
Val1n0r2019-09-23 22:41:36
Django
Val1n0r, 2019-09-23 22:41:36

How to save queryset to list?

Let's say I have a query like this

get_quest = win_row.objects.filter(user_quest_id=uid, quest_lvl__lte=user_lvl)

and like this
current_user_lvl = UserAttribute.objects.filter(user_id = uid)

Is it possible to save them in a list in this way
list = []
list.append(get_quest )
list.append(current_user_lvl )
context['get_quest'] = get_quest
context['current_user_lvl'] = current_user_lvl

to further pass them to the context and output them in a cycle in the template, like:
{% for i in current_user_lvl %}
{{ i }}
{% endfor %}

?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question