##// END OF EJS Templates
Added domain image for linux.org.ru, added ability to make images for third-level domains when it is an org.ru, com.ua, co.uk etc domain
Added domain image for linux.org.ru, added ability to make images for third-level domains when it is an org.ru, com.ua, co.uk etc domain

File last commit:

r1693:807f3415 default
r1724:70ff8482 default
Show More
random.py
25 lines | 598 B | text/x-python | PythonLexer
from django.shortcuts import render
from django.views.generic import View
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_protect
from boards.models import Attachment
__author__ = 'neko259'
TEMPLATE = 'boards/random.html'
CONTEXT_IMAGES = 'images'
RANDOM_POST_COUNT = 9
class RandomImageView(View):
@method_decorator(csrf_protect)
def get(self, request):
params = dict()
params[CONTEXT_IMAGES] = Attachment.objects.get_random_images(
RANDOM_POST_COUNT)
return render(request, TEMPLATE, params)