本文整理汇总了Python中models.Email.send_activation_email方法的典型用法代码示例。如果您正苦于以下问题:Python Email.send_activation_email方法的具体用法?Python Email.send_activation_email怎么用?Python Email.send_activation_email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Email
的用法示例。
在下文中一共展示了Email.send_activation_email方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models import Email [as 别名]
# 或者: from models.Email import send_activation_email [as 别名]
def post(self):
action = self.request.get("action")
if action == "reset":
self.account.set_hash_and_key()
elif action == "addemail":
email = self.request.get("email")
if not Email.find_existing(email):
e = Email(email=self.request.get("email"), account=self.account)
e.send_activation_email()
e.put()
elif action == "removeemail":
e = Email.get_by_id(int(self.request.get("email-id")))
if e.account.key() == self.account.key():
if e.hash() in self.account.hashes:
self.account.hashes.remove(e.hash())
self.account.put()
e.delete()
else:
if self.request.get("source_enabled", None):
self.account.source_enabled = True
self.account.source_name = self.request.get("source_name", None)
self.account.source_url = self.request.get("source_url", None)
self.account.source_icon = self.request.get("source_icon", None)
else:
self.account.source_enabled = False
self.account.put()
self.redirect("/settings")