##// END OF EJS Templates
If thread is specified in the post template, do not load it again
If thread is specified in the post template, do not load it again

File last commit:

r1590:0eb7ac3c default
r1670:c9facaf1 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)