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


Python Score.value方法代码示例

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


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

示例1: initialiseScoring

# 需要导入模块: from models import Score [as 别名]
# 或者: from models.Score import value [as 别名]
def initialiseScoring(request):
	score = Score.objects(type='submitidea')
	if not score:
		score = Score()
		score.type='submitidea'
		score.value=100
		score.save()
	
	score = Score.objects(type='submitarticle')
	if not score:
		score = Score()
		score.type='submitarticle'
		score.value=80
		score.save()
	
	score = Score.objects(type='comment')
	if not score:
		score = Score()
		score.type='comment'
		score.value=50
		score.save()
	
	score = Score.objects(type='vote')
	if not score:
		score = Score()
		score.type='vote'
		score.value=40
		score.save()

	score = Score.objects(type='report')
	if not score:
		score = Score()
		score.type='report'
		score.value=20
		score.save()
	
	score = Score.objects(type='view')
	if not score:
		score = Score()
		score.type='view'
		score.value=10
		score.save()
	
	score = Score.objects(type='promotion')
	if not score:
		score = Score()
		score.type='promotion'
		score.value=80
		score.save()
		
	initialiseRatings()
	return HttpResponseRedirect('/')
开发者ID:naughtond,项目名称:innuvate,代码行数:54,代码来源:views.py

示例2: get

# 需要导入模块: from models import Score [as 别名]
# 或者: from models.Score import value [as 别名]
	def get( self ):
		game_name = self.request.get( 'game_name' )
		game_level_number = self.request.get( 'game_level_number', None )
                if game_level_number: game_level_number = int( game_level_number )
		player_name = self.request.get( 'player_name' )
		value = int( self.request.get( 'value' ) )

		model = Score()
		model.game_name = game_name
                model.game_level_number = game_level_number
		model.player_name = player_name
		model.value = value
		model.put()
	
                self.send_json_response( True )
开发者ID:Ponup,项目名称:api-server,代码行数:17,代码来源:score.py


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