Exemplo n.º 1
0
    def get(self):
        session = get_current_session()
        if session.has_key('user'):
            user = session['user']
            page = helper.sanitizeHtml(self.request.get('pagina'))
            perPage = 10
            page = int(page) if page else 1
            realPage = page - 1
            inboxAll = True
            if realPage > 0:
                prevPage = realPage
            if (page * perPage) < Notification.all().filter(
                    "target_user ="******"target_user ="******"-created").fetch(perPage, perPage * realPage)
            prefetch.prefetch_refprops(notifications, Notification.post,
                                       Notification.comment,
                                       Notification.sender_user)
            self.response.out.write(
                template.render('templates/notifications.html', locals()))
        else:
            self.redirect('/login')
Exemplo n.º 2
0
  def get(self):
    session = get_current_session()
    if session.has_key('user'):
      user = session['user']
      page = helper.sanitizeHtml(self.request.get('pagina'))
      perPage = 10
      page = int(page) if page else 1
      realPage = page - 1
      inboxAll = True
      if realPage > 0:
        prevPage = realPage
      if (page * perPage) < Notification.all().filter("target_user ="******"target_user ="******"-created").fetch(perPage,perPage * realPage)
      prefetch.prefetch_refprops(notifications,Notification.post,Notification.comment,Notification.sender_user)
      self.response.out.write(template.render('templates/notifications.html', locals()))
    else:
      self.redirect('/login')