本文整理汇总了Python中storyengine.model.account.Account.get_by_accountid方法的典型用法代码示例。如果您正苦于以下问题:Python Account.get_by_accountid方法的具体用法?Python Account.get_by_accountid怎么用?Python Account.get_by_accountid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类storyengine.model.account.Account
的用法示例。
在下文中一共展示了Account.get_by_accountid方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def post(self): #logout
accountid = self.session.get('accountid')
account_ = Account.get_by_accountid(accountid)
towhom_ = None
try:
towhom_ = Account.get_by_accountid(int(towhomID))
except:
towhom_ = None
params = {}
params['dataID'] = self.request.get('dataID')
params['cost'] = self.request.get('cost')
params['receipt_type'] = self.request.get('receipt_type')
Receipt.new(params,account_,towhom_)
self.redirect('/'+accountid+'/')
示例2: get
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def get(self):
result = self.request.get('result')
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
if 1 != account.mod:
return
f_data = {
'testcode':
'{"id":"4","lang":"ko"}'
}
s_form = APIForm(f_data)
cinput = "/app/story/%d?lang=%s"
coutput = """success={success=True,
id=%s(key_id),index=%d,version=%d,visible=%d,
expiration_date=%d,
lang=%s,name=%s,description=%s,
price=%d,main_categoryid=%s(key_name),
pages=[%d(key_id),%d,%d,%d],
purchased=True/False,
}
error={success=False,error='the reason of error',
id=%s(key_id),
}
"""
context = {'static_path': STATIC_PATH,
'input':cinput,
'output':coutput,
'result':result,
'form':s_form}
self.render_to_response('apitest_index.html',context)
示例3: get
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def get(self):
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
if 1 != account.mod:
return
mode = self.request.get('mode')
keytodel = self.request.get('del')
if 'all' == mode:
pages = Page.all().order('-created')
else:
pages = Page.all().order('-created').fetch(limit=5)
pagelist = []
Next = namedtuple("Next", "pageid contentid")
for page in pages:
page.keyname = str(page.key().id())
if page.contents.count() > 0: #content at foremost
page.content = page.contents[0].content
page.content.keyid = page.content.key().id()
childlist = []
for l in page.childs:
if l.child_page.contents.count() > 0:
n = Next(l.child_page.key().id(), l.child_page.contents[0].content.key().id())
childlist.append(n)
page.childlist = childlist
pagelist.append(page)
context = {'static_path': STATIC_PATH,
'APP_TITLE' : APP_TITLE,
'pages':pagelist,
'keytodel':keytodel,
'size':len(pagelist)}
self.render_to_response('page_index.html',context)
示例4: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def post(self,pageid):
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
if 1 != account.mod:
return
contentlist = []
contentid = self.request.get('contentid')
nameen = self.request.get('nameen')
nameko = self.request.get('nameko')
if "" != contentid:
i = Content.get_by_id(int(contentid))
i.keyid = i.key().id()
contentlist.append(i)
elif "" != nameen:
result = Content.all().filter("nameen =",nameen)
for i in result :
i.keyid = i.key().id()
contentlist.append(i)
elif "" != nameko:
result = Content.all().filter("nameko =",nameko)
for i in result :
i.keyid = i.key().id()
contentlist.append(i)
context = {'static_path': STATIC_PATH,
'APP_TITLE' : APP_TITLE,
'contents':contentlist,
'pageid':pageid,
}
self.render_to_response('page_content_search.html',context)
示例5: get
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def get(self):
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
if 1 != account.mod:
return
if None is accountid:
context = {'static_path': STATIC_PATH,
'APP_TITLE' : APP_TITLE,
'err_msg':"You should login"}
self.render_to_response('err_page.html',context)
return
keytodel = self.request.get('del')
stories = Story.all()
stories.order('-created')
storylist = []
for story in stories:
story.keyname = str(story.key().id())
storylist.append(story)
storysortedlist = sorted(storylist, key=lambda p: p.index)
context = {'static_path': STATIC_PATH,
'APP_TITLE' : APP_TITLE,
'stories':storysortedlist,
'keytodel':keytodel,
'size':len(storylist)}
self.render_to_response('story_index.html',context)
示例6: get
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def get(self,contentid):
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
if 1 != account.mod:
return
content = Content.get_by_id(int(contentid))
content.delete()
self.redirect('/content')
示例7: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def post(self):
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
testcode = self.request.get('testcode')
assert(testcode)
d = json.loads(testcode)
assert(d)
det = Account.api_gift(d['coin'],d['candy'],account)
self.redirect(self.request.url + 'input?result='+str(det))
示例8: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def post(self,keyid): #logout
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
story_ = Story.get_by_id(int(keyid))
page = Page.new(account,story_)
pageid = int(self.request.get('pageid'))
pageToImport = Page.get_by_id(int(pageid))
for link in pageToImport.contents:
PageContentLink.new(page,link.content)
self.redirect('/story/'+keyid)
示例9: get
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def get(self,categoryid):
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
if 1 != account.mod:
return
lang = self.request.get('lang')
category = Category.getter(categoryid)
category.support_tostudy_del(lang)
category.put()
self.redirect('/category/'+categoryid)
示例10: get
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def get(self):
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
if 1 != account.mod:
return
s_form = ReceiptInfoForm(None)
context = {'static_path': STATIC_PATH,
'form':s_form}
self.render_to_response('form.html',context)
示例11: get
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def get(self,accountid):
account = Account.get_by_accountid(accountid)
logging.info('get')
if 1 != account.mod:
return
f_data = account.to_formdict()
s_form = AccountInfoForm(f_data)
context = {'static_path': STATIC_PATH,
'APP_TITLE' : APP_TITLE,
'form':s_form}
self.render_to_response('form.html',context)
示例12: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def post(self,contentid): #logout
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
if 1 != account.mod:
return
content = Content.get_by_id(int(contentid))
params = {}
for key in self.request.arguments():
params[key] = self.request.get(key)
content.setter(params)
self.redirect('/content')
示例13: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def post(self,accountid):
logging.info('asdfdszzzf')
account = Account.get_by_accountid(accountid)
logging.info('asdfdsf')
# if 1 != account.mod:
# return
params = {}
for key in self.request.arguments():
params[key] = self.request.get(key)
account.setter(params)
self.redirect('/account')
示例14: post
# 需要导入模块: from storyengine.model.account import Account [as 别名]
# 或者: from storyengine.model.account.Account import get_by_accountid [as 别名]
def post(self,category_name):
accountid = self.session.get('accountid')
account = Account.get_by_accountid(accountid)
if 1 != account.mod:
return
storyid = self.request.get('storyid')
category = Category.getter(category_name)
story = Story.get_by_id(int(storyid))
CategoryStoryLink.new(category,story)
self.redirect('/category/'+category_name)