Templates & Views Flashcards

(3 cards)

1
Q

What does as_view() do in class-based views?

A

Converts the class into a callable view function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you paginate results?

A

Add paginate_by = <num> in ListView.</num>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What’s the syntax to loop in a template?

A

{% for item in list %} … {% endfor %}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly