def index(request): showcases = Showcase.all().filter('is_display =', True).order("-add_time") paginator = Paginator(showcases, 5) try: page = int(request.args.get('page', 1)) except ValueError: page = 1 try: showcases = paginator.page(page) except (EmptyPage, InvalidPage): showcases = paginator.page(paginator.num_pages()) return render_to_response('showcase/index.html', { 'showcases': showcases })
def admin_list(request): showcases = Showcase.all().order('-add_time') return render_to_response('showcase/admin/list.html', {'showcases':showcases})
def showcases(request): showcases_objs = Showcase.all() return render_json_response([to_dict(o) for o in showcases_objs])