Beispiel #1
0
 def get_response(self):
     data = dict()
     if self.name.decode(encoding='utf-8') == "admin":
         data["site_title"] = "后台管理_" + self.site_name
         data["video"] = self.page(Database.get_videos())
         self.html("admin/manage.html", data=data)
     else:
         data["site_name"] = self.site_name
         self.html("404.html", data=data)
Beispiel #2
0
    def get(self, *args, **kwargs):
        videos = Database.get_videos()
        data = dict()
        tags = []
        for video in videos:
            for tag in video.tags.split(" / "):
                if tag:
                    tags.append(tag)
        tags = {}.fromkeys(tags).keys()

        data["tags"] = []
        index = 4
        for tag in tags:
            index += 1
            temp = dict()
            temp["index"] = index
            temp["name"] = tag
            data["tags"].append(temp)

        self.render("sitemap.html", data=data)