Пример #1
0
def viewGallery(request):

  try:
      page = int(request.GET.get('step', '1')) - 1
  except:
      page = 0

  data = Picture.all()
  paginator = ObjectPaginator(data, 25)
  if page>=paginator.pages:
      page = paginator.pages - 1

  params = {
      "pictures" : paginator.get_page(page),
      "steps" : range(1,paginator.pages+1),
      "step" : page+1
  }

  return respond(request, 'gallery.html', params)
Пример #2
0
 def get(self):
     self.render("templates/picture.html", {"piclist": Picture.all()})