Inventory.py 文件源码

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

项目:QXSConsolas 作者: qxsch 项目源码 文件源码
def getObjectIdByName(self, object_name, object_subname=None):
        andList = [ md.InventoryObjects.c.class_id == self._classId, md.InventoryObjects.c.object_name == object_name ]
        if not object_subname is None:
            andList.append(md.InventoryObjects.c.object_subname == object_subname)
        object_id = None
        i = 0
        for row in self._connection.execute(md.InventoryObjects.select().where(and_(*andList))):
            i = i + 1
            object_id = row["object_id"]
        if i > 1:
            raise LookupException("Too many objects were found")
        if i == 0:
            raise EmptyLookupException("No objects were found")
        return object_id
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号