2020-11-21 15:11:32 +01:00
|
|
|
from django.views import generic
|
2020-11-21 11:41:15 +01:00
|
|
|
|
2020-11-21 15:11:32 +01:00
|
|
|
from exercises.models import Exercise
|
|
|
|
|
|
|
|
|
|
|
|
class RandomExercisesView(generic.ListView):
|
|
|
|
model = Exercise
|
|
|
|
context_object_name = "exercises"
|
|
|
|
|
|
|
|
def get_queryset(self):
|
|
|
|
return Exercise.objects.order_by("?")[:5]
|