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


Python Member.get方法代码示例

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


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

示例1: post

# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import get [as 别名]
    def post(self, member_id):
        import constants
        member = Member.get(member_id)
        if member.status.name == constants.SIGNUP_STATUS_NAME:
            member.status = self.get_status(constants.WELCOME_LETTER_NAME)
            # update the status to paid membership due.
            dues = MembershipDues.all().ancestor(member).fetch(25)

            current_year = datetime.datetime.now().year
            # Set next year if this at the end of the previous.
            if (datetime.datetime.now().month >= 11):
                current_year = current_year + 1

            found = False
            for due in dues:
                if due.year == current_year:
                    due.paid = True
                    found = True
                    print 'Updated existing due'
                    due.put()
            if not found:
                print 'Due not found, created new'
                due = MembershipDues(parent=member, year=current_year, paid=True)
                due.put()
            member.put()
        elif member.status.name == constants.WELCOME_LETTER_NAME:
            member.status = self.get_status(constants.DEFAULT_MEMBER_STATUS_NAME)
            member.put()
        destination = self.request.get('return')
        return self.redirect(destination)
开发者ID:,项目名称:,代码行数:32,代码来源:

示例2: get

# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import get [as 别名]
    def get(self, member_id, car_id):
        template = JINJA_ENVIRONMENT.get_template('templates/members/car_detail.html')
        member = Member.get(member_id)
        car = Car.get(car_id)

        selector_template = JINJA_ENVIRONMENT.get_template('templates/carselector.html')

        data = {
            'car': car,
            'member': member,
            'carselector_html': selector_template.render()
        }
        self.response.write(template.render(data))
开发者ID:,项目名称:,代码行数:15,代码来源:

示例3: get_member

# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import get [as 别名]
    def get_member(self, member_no):
        (memberno, access_code) = self.get_cookie()

        member = Member.get(member_no)
        if not member:
            self.abort(400)

        if not member.number == memberno:
            self.abort(400)

        if member.edit_access_code.lower().strip() != access_code:
            self.abort(400)

        return member
开发者ID:,项目名称:,代码行数:16,代码来源:


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