本文整理匯總了Python中models.Channel.gql方法的典型用法代碼示例。如果您正苦於以下問題:Python Channel.gql方法的具體用法?Python Channel.gql怎麽用?Python Channel.gql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Channel
的用法示例。
在下文中一共展示了Channel.gql方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: decorated_view
# 需要導入模塊: from models import Channel [as 別名]
# 或者: from models.Channel import gql [as 別名]
def decorated_view(*args, **kwargs):
channel=kwargs['channel']
channel=Channel.gql("WHERE id = :1", channel).get()
if channel:
kwargs['channel']=channel
return func(*args, **kwargs)
return redirect(url_for('qq.list_channels'))
示例2: populate
# 需要導入模塊: from models import Channel [as 別名]
# 或者: from models.Channel import gql [as 別名]
def populate():
q=Channel.gql("WHERE id=:1", 'koan')
channel=q.get()
code="""
__author__ = 'peter'
from application import settings
import logging
MSG_TYPE_TEXT = u'text'
MSG_TYPE_LOCATION = u'location'
MSG_TYPE_IMAGE = u'image'
def process_text(remark, retort):
if remark['content']:
retort['content']='Bot Spawned!'
retort['msgType']=MSG_TYPE_TEXT
retort['funcFlag']=0
return retort
def process_location(remark, retort):
return retort
def process_image(remark, retort):
return retort
"""
bot=Bot(name=u'spawn', code=code, channel=channel.key)
bot.put()
return 'populated.'