本文整理汇总了Python中GlobalUtilities.moneyAmount方法的典型用法代码示例。如果您正苦于以下问题:Python GlobalUtilities.moneyAmount方法的具体用法?Python GlobalUtilities.moneyAmount怎么用?Python GlobalUtilities.moneyAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobalUtilities
的用法示例。
在下文中一共展示了GlobalUtilities.moneyAmount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: semi_get_individual_donations
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import moneyAmount [as 别名]
def semi_get_individual_donations(self, req):
isAdmin, s = tools.checkAuthentication(self, False, from_endpoints=True)
query = "individual_key:" + str(req.individual_key)
results = s.search.donation(query, query_cursor=req.query_cursor)
logging.info("Getting individual donations with query: " + query)
donations = []
new_cursor = tools.getWebsafeCursor(results[1])
for d in results[0]:
f = d.fields
team_name = f[6].value
if team_name == None:
team_name = ""
donation = Donation_Data(key=f[0].value, formatted_donation_date=f[9].value, name=f[2].value,
email=tools.truncateEmail(f[3].value),
payment_type=f[5].value, amount_donated=tools.moneyAmount(f[4].value),
team_name=team_name)
donations.append(donation)
return Donations_Out(objects=donations, new_cursor=new_cursor)
示例2: get_team_donation_total
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import moneyAmount [as 别名]
def get_team_donation_total(self, req):
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
t = tools.getKey(req.team_key).get()
donation_total = tools.moneyAmount(t.data.donation_total)
return GetTeamDonationTotal_Out(donation_total=donation_total)
示例3: get_team_totals
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import moneyAmount [as 别名]
def get_team_totals(self, req):
s = tools.getSettingsKey(self, endpoints=True).get()
i = tools.getKey(req.individual_key).get()
team_totals = []
for tl in i.teamlist_entities:
total = GetTeamTotals_Data(team_name=tl.team_name, donation_total=tools.moneyAmount(tl.data.donation_total))
team_totals.append(total)
return GetTeamTotals_Out(team_totals=team_totals)
示例4: get_team_members
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import moneyAmount [as 别名]
def get_team_members(self, req):
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
query = "team_key:" + str(req.team_key)
results = s.search.individual(query, query_cursor=req.query_cursor)
logging.info("Getting team members with query: " + query)
individuals = []
new_cursor = tools.getWebsafeCursor(results[1])
for i in results[0]:
f = i.fields
individual = Individual_Data(key=f[0].value, name=f[1].value, email=f[2].value,
raised=tools.moneyAmount(f[4].value))
individuals.append(individual)
return Individuals_Out(objects=individuals, new_cursor=new_cursor)
示例5: get_teams
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import moneyAmount [as 别名]
def get_teams(self, req):
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
if req.query == None:
req.query = ""
results = s.search.team(req.query, query_cursor=req.query_cursor)
logging.info("Getting teams with query: " + req.query)
teams = []
new_cursor = tools.getWebsafeCursor(results[1])
for t in results[0]:
f = t.fields
team = Team_Data(key=f[0].value, name=f[1].value, donation_total=tools.moneyAmount(f[2].value))
teams.append(team)
return Teams_Out(objects=teams, new_cursor=new_cursor)