本文整理匯總了Python中models.GameLevel.GameLevel.count方法的典型用法代碼示例。如果您正苦於以下問題:Python GameLevel.count方法的具體用法?Python GameLevel.count怎麽用?Python GameLevel.count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.GameLevel.GameLevel
的用法示例。
在下文中一共展示了GameLevel.count方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: export_game_objects
# 需要導入模塊: from models.GameLevel import GameLevel [as 別名]
# 或者: from models.GameLevel.GameLevel 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)