Пример #1
0
def images(request, channel=None, nsfw=None):
    template = loader.get_template('viewer/images.html')
    images = Image.objects.order_by('-posted_time')
    #TODO: this could get expensive with large amounts of images
    channels = set([x.posted_channel for x in Image.objects.all()])
    c = context(request)
    c.update({'images': images, 'channels': channels})
    return HttpResponse(template.render(c))
Пример #2
0
Файл: images.py Проект: japz/bot
def images(request, channel=None, nsfw=None, template='viewer/images/index.html', extra_context=None):
    images = Image.objects.order_by('-posted_time')
    #TODO: this could get expensive with large amounts of images
    channels = set([x.posted_channel for x in Image.objects.all()])
    c = context(request)
    c.update({'images': images, 'channels': channels})
    if extra_context is not None:
        c.update(extra_context)
    return render_to_response(template, c, context_instance=RequestContext(request))
Пример #3
0
def images(request,
           channel=None,
           nsfw=None,
           template='viewer/images/index.html',
           extra_context=None):
    images = Image.objects.order_by('-posted_time')
    #TODO: this could get expensive with large amounts of images
    channels = set([x.posted_channel for x in Image.objects.all()])
    c = context(request)
    c.update({'images': images, 'channels': channels})
    if extra_context is not None:
        c.update(extra_context)
    return render_to_response(template,
                              c,
                              context_instance=RequestContext(request))
Пример #4
0
def index(request):
    template = loader.get_template('viewer/index.html')
    c = context(request)
    return HttpResponse(template.render(c))
Пример #5
0
def index(request):
    template = loader.get_template('viewer/index.html')
    c = context(request)
    return HttpResponse(template.render(c))