Exemplo n.º 1
0
    def get(self):
        if not checkUser(self):
            self.response.out.write("1")
            return
        userName = self.request.get("UserName").strip()
        xml = None
        datas = None
        codeListAll = []  # 全要型的订阅
        codeListPart = []  # 只要本层订阅方式
        deleteListCode = []
        for sub in Subscribe.all().filter("userName in", [userName, "000"]).filter("status =", "1"):
            if "0" == sub.subscribeType:
                codeListAll.append(sub.code)
            codeListPart.append(sub.code)

        xml, datas = infoallxmldic(ContentClass.get_by_key_name(codeListPart), xml, datas)
        for c in codeListAll:
            xml, datas = infoallxmldic(findChildNodes(c).filter("userName ="******""), xml, datas)
        xml, datas = infoallxmldic(
            ContentClass.all().filter("userName ="******"status =", "1"), xml, datas
        )
        datas.setAttribute("type", "infoall")
        datas.setAttribute("code", "main")
        datas.setAttribute("verson", AppPhoneVerson)
        datas.setAttribute("download", AppPhoneUri)
        userAppData(userName, datas)
        self.response.out.write(xml.toxml("utf-8"))
        return
Exemplo n.º 2
0
 def get(self):
     if not checkUser(self):
         self.response.out.write("1")
         return
     userName = self.request.get("UserName").strip()
     xml = None
     datas = None
     userUpdate = UserUpdate.get_by_userName(userName)
     codeListPart = userUpdate.updateContent  # 只要本层订阅方式
     codeListAll = []  # 全要型的订阅
     codeListDelete = []
     for sub in Subscribe.get_by_key_name(userUpdate.updateSubscribe):
         if "0" == sub.status:
             codeListDelete.append(sub.code)
         else:
             if "0" == sub.subscribeType:
                 codeListAll.append(sub.code)
             codeListPart.append(sub.code)
     xml, datas = infoallxmldic(ContentClass.get_by_key_name(codeListPart), xml, datas)
     for c in codeListAll:
         xml, datas = infoallxmldic(findChildNodes(c, "1").filter("userName ="******""), xml, datas)
     xml, datas = infoallxmldic(codeListDelete, xml, datas, True)
     datas.setAttribute("type", "infoupdate")
     userAppData(userName, datas)
     self.response.out.write(xml.toxml("utf-8"))
     userUpdate.updateSubscribe = []
     userUpdate.updateContent = []
     userUpdate.put()
     return