You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
433 B
16 lines
433 B
#-*- coding: utf-8 -*-
|
|
|
|
# from django.core.urlresolvers import reverse
|
|
# from django.http import HttpResponseRedirect
|
|
# from django.shortcuts import get_object_or_404, render
|
|
from django.views import generic
|
|
|
|
from .models import Promo
|
|
|
|
|
|
class IndexView(generic.ListView):
|
|
template_name = 'promo/index.html'
|
|
context_object_name = 'random_promo'
|
|
|
|
def get_queryset(self):
|
|
return Promo.objects.all().order_by('?')[0]
|
|
|