Ejemplo n.º 1
0
    def get(self):
        offset = self.request.get("offset")

        if not offset:
            offset = 0

        if users.get_current_user().__str__().upper() != "kisflying".upper():
            return self.redirect(users.create_login_url("/clipboard/"))

        count = Clipboard.all().count()
        clips = Clipboard.all().order("-CreateDateTime").fetch(50, int(offset))

        template_values = {"clips": clips, "count": count}

        path = os.path.join(os.path.dirname(__file__), "templates/clipboard.html")
        self.response.out.write(template.render(path, template_values))