vijay jagtap
vijay jagtap

Reputation: 11

Django - How to iterate queryset object in template

I am trying to develop a quiz app in django class base view. i get all questions in questions and render to template. i want access one by one questions using html next button. so suggest me any backend code required or by using javascript we can iterate?

View.py

Upvotes: 1

Views: 52

Answers (1)

Swift
Swift

Reputation: 1711

thanks for posting.

{% for question in questions %}
    Do stuff with each question
{% empty %}
    Do stuff when there's no questions
{% endfor %}

Upvotes: 1

Related Questions