本文整理汇总了Python中models.SpeakerForm.name方法的典型用法代码示例。如果您正苦于以下问题:Python SpeakerForm.name方法的具体用法?Python SpeakerForm.name怎么用?Python SpeakerForm.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.SpeakerForm
的用法示例。
在下文中一共展示了SpeakerForm.name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getFeaturedSpeaker
# 需要导入模块: from models import SpeakerForm [as 别名]
# 或者: from models.SpeakerForm import name [as 别名]
def getFeaturedSpeaker(self, request):
"""Return all featured speakers from Memcache"""
featuredSpeakers = memcache.get(MEMCACHE_FEATURED_SPEAKER_KEY)
speakerForms = []
for speakerEmail in featuredSpeakers:
speaker = SessionSpeaker.query(SessionSpeaker.email == speakerEmail).get()
speakerForm = SpeakerForm()
speakerForm.name = speaker.name
speakerForm.email = speaker.email
speakerForm.check_initialized()
speakerForms.append(speakerForm)
return SpeakerForms(items=speakerForms)
示例2: _copySpeakerToForm
# 需要导入模块: from models import SpeakerForm [as 别名]
# 或者: from models.SpeakerForm import name [as 别名]
def _copySpeakerToForm(self, speaker):
"""Copy relevant fields from Speaker to SpeakerForm"""
# create a new entity first
sf = SpeakerForm()
# convert Speaker properties to SpeakerForm fields
sf.name = speaker.name
sf.bio = speaker.bio
sf.websafeKey = speaker.key.urlsafe()
# check and return
sf.check_initialized()
return sf