def attributeExists(self, object_id, attribute_name):
assert not (object_id is None), "At least one identifier must be set"
for count in self._connection.execute(ex.select([func.count()]).select_from(md.InventoryObjectAttributes).where(and_(md.InventoryObjectAttributes.c.class_id == self._classId, md.InventoryObjectAttributes.c.object_id == object_id, md.InventoryObjectAttributes.c.attr_key == attribute_name))):
count = count[0]
if count == 0:
return False
else:
return True
评论列表
文章目录