本文整理匯總了Python中kallithea.model.user.UserModel.delete_extra_email方法的典型用法代碼示例。如果您正苦於以下問題:Python UserModel.delete_extra_email方法的具體用法?Python UserModel.delete_extra_email怎麽用?Python UserModel.delete_extra_email使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kallithea.model.user.UserModel
的用法示例。
在下文中一共展示了UserModel.delete_extra_email方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: delete_email
# 需要導入模塊: from kallithea.model.user import UserModel [as 別名]
# 或者: from kallithea.model.user.UserModel import delete_extra_email [as 別名]
def delete_email(self, id):
user = self._get_user_or_raise_if_default(id)
email_id = request.POST.get('del_email_id')
user_model = UserModel()
user_model.delete_extra_email(id, email_id)
Session().commit()
h.flash(_("Removed email from user"), category='success')
raise HTTPFound(location=url('edit_user_emails', id=id))
示例2: delete_email
# 需要導入模塊: from kallithea.model.user import UserModel [as 別名]
# 或者: from kallithea.model.user.UserModel import delete_extra_email [as 別名]
def delete_email(self, id):
"""DELETE /user_emails_delete/id: Delete an existing item"""
# url('user_emails_delete', id=ID, method='delete')
email_id = request.POST.get('del_email_id')
user_model = UserModel()
user_model.delete_extra_email(id, email_id)
Session().commit()
h.flash(_("Removed email from user"), category='success')
return redirect(url('edit_user_emails', id=id))