本文整理汇总了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.'