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


Python Corporation.by_id方法代码示例

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


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

示例1: to_dict

# 需要导入模块: from models.Corporation import Corporation [as 别名]
# 或者: from models.Corporation.Corporation import by_id [as 别名]
 def to_dict(self):
     ''' Returns editable data as a dictionary '''
     corp = Corporation.by_id(self.corporation_id)
     game_level = GameLevel.by_id(self.game_level_id)
     return {
         'name': self.name,
         'uuid': self.uuid,
         'corporation': corp.uuid,
         'description': self._description,
         'difficulty': self.difficulty,
         'game_level': game_level.uuid,
     }
开发者ID:AdaFormacion,项目名称:RootTheBox,代码行数:14,代码来源:Box.py

示例2: has_box_materials

# 需要导入模块: from models.Corporation import Corporation [as 别名]
# 或者: from models.Corporation.Corporation import by_id [as 别名]
def has_box_materials(box):
    if not options.use_box_materials_dir:
        return False

    d=options.game_materials_dir
    path = os.path.join(d, box.name)
    if os.path.isdir(path):
        return box.name
    else:
        corp = Corporation.by_id(box.corporation_id)
        path = os.path.join(d, corp.name, box.name)
    if os.path.isdir(path):
        return os.path.join(corp.name, box.name)
    return False
开发者ID:moloch--,项目名称:RootTheBox,代码行数:16,代码来源:MaterialsHandler.py

示例3: to_dict

# 需要导入模块: from models.Corporation import Corporation [as 别名]
# 或者: from models.Corporation.Corporation import by_id [as 别名]
 def to_dict(self):
     ''' Returns editable data as a dictionary '''
     corp = Corporation.by_id(self.corporation_id)
     game_level = GameLevel.by_id(self.game_level_id)
     cat = Category.by_id(self.category_id)
     if cat:
         category = cat.uuid
     else:
         category = ""
     return {
         'name': self.name,
         'uuid': self.uuid,
         'corporation': corp.uuid,
         'category': category,
         'operating_system': self.operating_system,
         'description': self._description,
         'difficulty': self.difficulty,
         'game_level': game_level.uuid,
         'flag_submission_type': self.flag_submission_type,
         'flaglist': self.flaglist(self.id)
     }
开发者ID:moloch--,项目名称:RootTheBox,代码行数:23,代码来源:Box.py

示例4: corporation

# 需要导入模块: from models.Corporation import Corporation [as 别名]
# 或者: from models.Corporation.Corporation import by_id [as 别名]
 def corporation(self):
     return Corporation.by_id(self.corporation_id)
开发者ID:brutalhonesty,项目名称:RootTheBox,代码行数:4,代码来源:Box.py


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