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))
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))
def index(request): template = loader.get_template('viewer/index.html') c = context(request) return HttpResponse(template.render(c))