Exemplo n.º 1
0
 def baseTemplateValues(self):
     bookmarklet = get_bookmarklet_launcher()
     user = social.get_current_user()
     return {
         "user": user,
         "bookmarklet": bookmarklet,
         "logout": social.create_logout_url("/"),
     }
Exemplo n.º 2
0
    def get(self):
        user = social.get_current_user()
        urls = [url for url in self.removeInvalidUrls(model.Url.filter_by_user(user).order('-created').fetch(100)) if not url.is_deleted]
        devices = model.Device.filter_by_user(user).order('-name').fetch(10)

        template_values = self.baseTemplateValues();
        template_values.update({
            'urls': urls,
            'devices': devices,
            "user": user,
            "logout": social.create_logout_url("/"),
            "since": (datetime.datetime.now() - datetime.timedelta(hours=2)).isoformat()
        })
        self.response.out.write(template.render("templates/ui/urls.html", template_values))