viur.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:transfer 作者: viur-framework 项目源码 文件源码
def storeEntry(self, modul, entry):
        if not entry:
            return

        id = entry["id"]
        k = Key(encoded=id)
        if k.kind() != modul:
            raise ValueError("Invalid key! Key's kind should be %s, is %s" % (modul,k.kind()))
        if k.app() != self.getAppId():
            raise ValueError("Invalid key! Key's app should be %s, is %s" % (self.getAppId(),k.app()))
        try:
            t = {}
            for k,v in entry.items():
                if isinstance(v,unicode):
                    v = v.encode("UTF-8")
                t[k] = v
            self.ns.request("/dbtransfer/storeEntry", {"e":pickle.dumps(t).encode("HEX"),"key":self.importKey})
        except:
            print("------")
            print( entry )
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号