示例#1
0
    def what(self):
        jsfiles = ["jquery"]
        rendered0 = sh.sourced_js(jsfiles, True)
        c.jsfiles = rendered0
        c.whatUser = "******"
        c.albumnames = []
        c.artistnames = []

        uname = sh.unameFromCookie(request.cookies["authkit"])

        import dbs.requests.request as r

        params = {"action": "getArtists"}
        c.artistnames = r.requestWithParams(uname, "what", params, True)
        params = {"action": "getAlbums"}
        c.albumnames = r.requestWithParams(uname, "what", params, True)

        return self.serveMako("what")
示例#2
0
    def index(self):
        # Return a rendered template
        # return render('/plug.mako')
        # or, return a responsels t

        w = sh.wrap("config")
        d = w.queryToDict(
            "select plugin.name  as name, user.name as uname from plugin, user where user.id = plugin.user;"
        )

        print d

        c.pluglist = map(lambda x: str(x["name"]), d)
        c.plugnames = map(lambda x: str(x["uname"]), d)
        c.cname = "plug"
        c.cdesc = "Plugin html interface"
        c.methods = [{"n": "blank", "d": "none yet"}]
        jsfiles = ["jquery"]
        rendered0 = sh.sourced_js(jsfiles, True)
        rendered = rendered0 + render("/plug_list.mako")
        rendered = rendered + render("/describe_controller.mako")

        return rendered