##// END OF EJS Templates
Rename 'random' button to 'images' because it's clearer to understand what is...
Rename 'random' button to 'images' because it's clearer to understand what is random in there

File last commit:

r1249:93f2906a default
r1480:e02fed82 default
Show More
random.py
22 lines | 453 B | text/x-python | PythonLexer
from django.shortcuts import render
from django.views.generic import View
from boards.models import PostImage
__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] = PostImage.objects.get_random_images(
RANDOM_POST_COUNT)
return render(request, TEMPLATE, params)