本文整理汇总了Python中storyengine.model.account.Account.get_by_facebookid方法的典型用法代码示例。如果您正苦于以下问题:Python Account.get_by_facebookid方法的具体用法?Python Account.get_by_facebookid怎么用?Python Account.get_by_facebookid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类storyengine.model.account.Account
的用法示例。
在下文中一共展示了Account.get_by_facebookid方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_category_new
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_facebookid [as 别名]
def test_category_new():
facebookid = "[email protected]"
account = Account.get_by_facebookid(facebookid)
key_name = "TOEIC"
category = Category.new(key_name,account)
assert None != category
return
示例2: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_facebookid [as 别名]
def post(self):
if False == (USER_AGENT in self.request.headers["User-Agent"]):
self.response.out.write(json.dumps({'success':False}))
return
self.response.headers['Content-Type'] = 'application/json'
facebookid = self.request.get('facebookid')
account = Account.get_by_facebookid(facebookid)
params = {}
params['money'] = self.request.get('money')
params['candy'] = self.request.get('candy')
params['score'] = self.request.get('score')
params['maxscore'] = self.request.get('maxscore')
params['id'] = self.request.get('id')
logging.info('coin[%d] candy[%d] score[%d] max[%d]',
int(params['money']),
int(params['candy']),
int(params['score']),
int(params['maxscore']))
ret = Account.api_submit(params,account)
# params['cost'] = self.request.get('candy')
# params['itemcost'] = self.request.get('money')
# params['receipt_type'] = 'play'
# Receipt.new(params,account)
self.response.headers['Content-Type'] = 'application/json'
self.response.out.write(json.dumps(ret))
示例3: test_story_new
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_facebookid [as 别名]
def test_story_new():
facebookid = "[email protected]"
account = Account.get_by_facebookid(facebookid)
assert account
story = Story.new(account)
story.put()
assert story
return story
示例4: get
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_facebookid [as 别名]
def get(self):
facebookid = self.request.get("img_id")
account = Account.get_by_facebookid(str(facebookid))
assert(account)
if account.thumbnail:
self.response.headers['Content-Type'] = "image/jpg"
self.response.out.write(images.resize(account.thumbnail,50,50))
else:
self.response.out.write("no image")
示例5: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_facebookid [as 别名]
def post(self): #logout
if False == (USER_AGENT in self.request.headers["User-Agent"]):
self.response.out.write(json.dumps({'success':False}))
return
facebookid = self.request.get('facebookid')
account_ = Account.get_by_facebookid(facebookid)
towhom_ = None
try:
towhom_ = Account.get_by_accountid(towhomID)
except:
towhom_ = None
params = {}
params['id'] = 0
params['itemcost'] = 0
params['cost'] = self.request.get('cost')
params['receipt_type'] = self.request.get('receipt_type')
if "money" == params['receipt_type']:
params['receipt_data'] = self.request.get('receipt_data')
logging.info('receipt_data [%s]', params['receipt_data'])
receipt_data = params['receipt_data']
receipt_hash = str(hashlib.md5(str(receipt_data)).hexdigest())
result = Receipt.all().filter("receipt_hash =", receipt_hash)
if result != None and result.count() > 0 and result[0].receipt_hash == receipt_hash:
logging.error('Err! id:[%s] prev existed:[%s]', facebookid, result[0])
else:
postdata = {}
postdata['receipt-data'] = params['receipt_data']
http = urllib3.PoolManager()
r = http.request('POST','https://buy.itunes.apple.com/verifyReceipt',
fields=postdata)
# r = http.request('POST','https://sandbox.itunes.apple.com/verifyReceipt',
# fields=postdata)
t = json.loads(r.data)
if 0 != int(t['status']) :
logging.error('ID:[%s] cost:[%s] status:[%s]', str(facebookid), str(params['cost']), str(t['status']))
return self.response.out.write(json.dumps({'success':False}))
ret = Receipt.new(params,account_,towhom_)
self.response.headers['Content-Type'] = 'application/json'
self.response.out.write(json.dumps(ret))
示例6: test_content_new
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_facebookid [as 别名]
def test_content_new():
facebookid = "[email protected]"
account = Account.get_by_facebookid(facebookid)
content = Content.new(account)
assert None != content
return
示例7: test_page_new
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_facebookid [as 别名]
def test_page_new():
facebookid = "[email protected]"
account = Account.get_by_facebookid(facebookid)
page = Page.new(account)
assert None != page
return
示例8: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_facebookid [as 别名]
def post(self,storyid):
facebookid = self.request.get('facebookid')
account = Account.get_by_facebookid(facebookid)
ret = Story.api_purchase(storyid,account)
self.response.headers['Content-Type'] = 'application/json'
self.response.out.write(json.dumps(ret))