oxdata/oxdata/poster/views.py

26 lines
824 B
Python

# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
import os.path
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User
from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404
from django.template import RequestContext
from ox.django.shortcuts import render_to_json_response
from oxdata.lookup.models import MovieId
from oxdata.lookup.views import get_movie_id
import models
def poster(request):
movie_id = get_movie_id(request)
json = models.getPosters(movie_id, request.build_absolute_uri('/'))
return render_to_json_response(json)
def still(request):
movie_id = get_movie_id(request)
json = models.getPosters(movie_id, request.build_absolute_uri('/'), limit=lambda x, y: x>y)
return render_to_json_response(json)