##// END OF EJS Templates
Added tag 3.2.1 for changeset a03f50d9723e
Added tag 3.2.1 for changeset a03f50d9723e

File last commit:

r1590:0eb7ac3c default
r1645:4c743293 default
Show More
random.py
22 lines | 455 B | text/x-python | PythonLexer
from django.shortcuts import render
from django.views.generic import View
from boards.models import Attachment
__author__ = 'neko259'
TEMPLATE = 'boards/random.html'
CONTEXT_IMAGES = 'images'
RANDOM_POST_COUNT = 9
class RandomImageView(View):
def get(self, request):
params = dict()
params[CONTEXT_IMAGES] = Attachment.objects.get_random_images(
RANDOM_POST_COUNT)
return render(request, TEMPLATE, params)