本文整理汇总了Python中models.Member.semesters_paid方法的典型用法代码示例。如果您正苦于以下问题:Python Member.semesters_paid方法的具体用法?Python Member.semesters_paid怎么用?Python Member.semesters_paid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Member
的用法示例。
在下文中一共展示了Member.semesters_paid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models import Member [as 别名]
# 或者: from models.Member import semesters_paid [as 别名]
def post(self, args):
if not require_admin(self):
return
req_id = self.request.get('id')
if not req_id:
self.error(422)
return
member = Member.query(Member.id == req_id).get()
if not member:
member = Member()
member.id = req_id
# Update string values.
for str_param in ['name', 'dce', 'email', 'card_color', 'card_emblem']:
req_val = self.request.get(str_param)
if req_val or req_val == '':
req_val = req_val.strip()
setattr(member, str_param, urllib2.unquote(req_val))
# Update boolean values.
for bool_param in ['show','mailing_list', 'current_student', 'committee_rank', 'merit_rank1', 'merit_rank2', 'card_printed']:
req_val = self.request.get(bool_param)
setattr(member, bool_param, not not req_val)
# Update multi-select values.
member.semesters_paid = [float(semester) for semester in self.request.get('semesters_paid', allow_multiple=True)]
# Save the updated member.
member.put()
if member.never_paid:
self.redirect('/members/hidden', code=303)
return
self.redirect('/members/' + member.id, code=303)