当前位置: 首页>>代码示例>>Python>>正文


Python Member.get_by_email方法代码示例

本文整理汇总了Python中model.Member.get_by_email方法的典型用法代码示例。如果您正苦于以下问题:Python Member.get_by_email方法的具体用法?Python Member.get_by_email怎么用?Python Member.get_by_email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在model.Member的用法示例。


在下文中一共展示了Member.get_by_email方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: post

# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import get_by_email [as 别名]
 def post(self):
     email = self.session['member']
     track_id = self['track_id']
     program_id = self['program_id']
     program = Program.get_by_key_name(program_id, parent=Track.get_by_key_name(track_id))
     EnrollProgram.create(Member.get_by_email(email), program)
     self.redirect("/tracks/program_listing?program_id=%s&track_id=%s"%(program_id, track_id))
开发者ID:aiyappaganesh,项目名称:beaglesloft,代码行数:9,代码来源:members.py

示例2: get

# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import get_by_email [as 别名]
 def get(self):
     track = Track.get_by_key_name(self['track_id'])
     program = Program.get_by_key_name(self['program_id'], parent=track)
     modules = ProgramModule.all().ancestor(program).order('name')
     template_values = {'program':program,
                        'track':track,
                        'modules':modules,
                        'listing_heading':program.name}
     template_values['is_member'] = True if 'member' in self.session else False
     if 'member' in self.session:
         email = self.session['member']
         member = Member.get_by_email(email)
         template_values['member'] = member
         if member.role == MEMBER_ROLE[MANAGER]:
             template_values['is_manager'] = True
         else:
             modules_count = modules.count()*1.0
             completed_modules = []
             for module in modules:
                 if module.completed:
                     completed_modules.append(module)
             completed_modules_count = len(completed_modules)
             score = (completed_modules_count/modules_count)*100.0
             engage_score = round(score*random(),0)
             engage_score = int(engage_score) if engage_score > 1 else 1
             template_values['donuts'] = DonutFactory.get_donuts(100, 0.875, [('Engineer1', [DonutSegment(engage_score, '#1c758a'), DonutSegment(score, '#58c4dd')], '/assets/img/tracks/mobile_dev.png')], 'transparent', '#ddd')
     self.render_template(template_name='program_listing.html', template_values=template_values)
开发者ID:aiyappaganesh,项目名称:beaglesloft,代码行数:29,代码来源:tracks.py

示例3: get

# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import get_by_email [as 别名]
 def get(self):
     path = 'member_profile_image.html'
     email = self.session['member']
     member = Member.get_by_email(email)
     image_upload_url = blobstore.create_upload_url('/api/members/' + email + '/update')
     template_values = {'member': member, 'image_upload_url': image_upload_url}
     template_values['is_member'] = True if 'member' in self.session else False
     #if 'member' in self.session:
     #    template_values['member'] = Member.get_member_json(self.session['member'])
     self.write(self.get_rendered_html(path, template_values), 200)
开发者ID:aiyappaganesh,项目名称:beaglesloft,代码行数:12,代码来源:members.py


注:本文中的model.Member.get_by_email方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。