当前位置: 首页>>代码示例>>Python>>正文


Python Device.all方法代码示例

本文整理汇总了Python中device.Device.all方法的典型用法代码示例。如果您正苦于以下问题:Python Device.all方法的具体用法?Python Device.all怎么用?Python Device.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在device.Device的用法示例。


在下文中一共展示了Device.all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: post

# 需要导入模块: from device import Device [as 别名]
# 或者: from device.Device import all [as 别名]
    def post(self):
        devName = self.request.get("deviceName")
        device_query = Device.all().filter("name = ", devName)
        devItem = device_query.fetch(1)[0]

        fwgName = self.request.get("fwgName")
        fw_query = FirmwareGroup.all().filter("name = ", fwgName)
        fwgItem = fw_query.fetch(1)[0]

        releaseNumber = self.request.get("releaseName")
        relQuery = Firmware.all().filter("group = ", fwgItem).filter("version = ", releaseNumber)
        relItem = relQuery.fetch(1)[0]

        installationTime = self.request.get("releaseDate")
        if installationTime.strip().lower() == "now":
            installationTime = None
        else:
            installationTime = datetime.strptime(installationTime, "%Y-%m-%d")

        gUser = users.get_current_user()
        query = User.all().filter("googleUser = ", gUser)
        res = query.fetch(1)
        myUser = res[0]

        udu = UserDeviceUpdates()
        udu.user = myUser
        udu.device = devItem
        udu.release = relItem
        if installationTime:
            udu.updateDatetime = installationTime
        udu.put()
开发者ID:kichkasch,项目名称:jumifiwaman,代码行数:33,代码来源:myuser_requesthandler.py

示例2: get

# 需要导入模块: from device import Device [as 别名]
# 或者: from device.Device import all [as 别名]
    def get(self):
        devName = self.request.get("devName")
        device_query = Device.all().filter("name = ", devName)
        devItem = device_query.fetch(1)[0]

        gUser = users.get_current_user()
        query = User.all().filter("googleUser = ", gUser)
        res = query.fetch(1)
        myUser = res[0]

        query = UserDeviceUpdates.all().filter("user = ", myUser).filter("device = ", devItem).order("-updateDatetime")
        releases = query.fetch(20)
        txt = ""
        for release in releases:
            txt += "<tr><td>%s</td><td>%s</td><td>%s</td></tr>\n" % (
                str(release.updateDatetime.date()),
                release.release.group.name,
                release.release.version,
            )
        self.response.out.write(txt)
开发者ID:kichkasch,项目名称:jumifiwaman,代码行数:22,代码来源:myuser_requesthandler.py


注:本文中的device.Device.all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。