本文整理汇总了Python中models.Corporation.Corporation.count方法的典型用法代码示例。如果您正苦于以下问题:Python Corporation.count方法的具体用法?Python Corporation.count怎么用?Python Corporation.count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Corporation.Corporation
的用法示例。
在下文中一共展示了Corporation.count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: export_game_objects
# 需要导入模块: from models.Corporation import Corporation [as 别名]
# 或者: from models.Corporation.Corporation import count [as 别名]
def export_game_objects(self, root):
'''
Exports the game objects to an XML doc.
For the record, I hate XML with a passion.
'''
levels_elem = ET.SubElement(root, "gamelevels")
levels_elem.set("count", str(GameLevel.count()))
for level in GameLevel.all()[1:]:
level.to_xml(levels_elem)
corps_elem = ET.SubElement(root, "corporations")
corps_elem.set("count", str(Corporation.count()))
for corp in Corporation.all():
corp.to_xml(corps_elem)