本文整理汇总了Python中users.User.email方法的典型用法代码示例。如果您正苦于以下问题:Python User.email方法的具体用法?Python User.email怎么用?Python User.email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类users.User
的用法示例。
在下文中一共展示了User.email方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register
# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import email [as 别名]
def register(session):
code = session.query(RegistrationCode).filter_by(value=request.form['code']).scalar()
if code is not None:
email_address = request.form['email']
user = User()
user.username = request.form['username']
password = generate_password()
user.password = password
user.email = email_address
user.role = 'user'
session.add(user)
session.delete(code)
send_mail('registration_email.html', 'Przenieś to potem gdzieś', email_address, password=password, username=user.username)
result = 'ok'
else:
result = 'wrong_code'
return render_template('register.html', result=result)
示例2: signup
# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import email [as 别名]
def signup():
if current_user.is_authenticated():
return redirect(url_for('user.index'))
loginForm = LoginForm()
form = SignupForm(next=request.args.get('next'))
if form.validate_on_submit():
user = User()
user.email = form.email.data.strip()
user.name = form.name.data.strip()
user.password = form.password.data
user.save()
if login_user(user):
return redirect(form.next.data or url_for('users.index'))
return render_template('frontend/login.html',
loginForm=loginForm,
signupForm=form)
示例3: create_profile
# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import email [as 别名]
def create_profile():
if current_user.is_authenticated():
return redirect(url_for('users.index'))
form = CreateProfileForm()
if form.validate_on_submit():
user = User()
user.email = form.email.data.strip()
user.password = form.password.data
user.github_id = session['github_id']
user.name = session['name']
user.github_username = session['github_username']
user.oauth_token = session['oauth_token']
user.location = session['location']
user.save()
if login_user(user):
flash(_("Logged in"), 'success')
return redirect(url_for('users.index'))
return render_template('frontend/create_profile.html',
form=form)
示例4: sync_from_server
# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import email [as 别名]
#.........这里部分代码省略.........
color = Colored()
color.color_id = colors['id']
color.company_id = colors['company_id']
color.color = colors['color']
color.name = colors['name']
color.ordered = colors['ordered']
color.status = colors['status']
color.deleted_at = colors['deleted_at']
color.created_at = colors['created_at']
color.updated_at = colors['updated_at']
# check to see if color_id already exists and update
count_color = color.where({'color_id': color.color_id})
if len(count_color) > 0 or color.deleted_at:
for data in count_color:
color.id = data['id']
if color.deleted_at:
color.delete()
else:
color.update_special()
else:
color.add_special()
color.close_connection()
if 'companies' in updates:
for companies in updates['companies']:
company = Company()
company.company_id = companies['id']
company.name = companies['name']
company.street = companies['street']
company.city = companies['city']
company.state = companies['state']
company.zip = companies['zip']
company.email = companies['email']
company.phone = companies['phone']
company.store_hours = companies['store_hours']
company.turn_around = companies['turn_around']
company.api_token = companies['api_token']
company.payment_gateway_id = companies['payment_gateway_id']
company.payment_api_login = companies['payment_api_login']
company.deleted_at = companies['deleted_at']
company.created_at = companies['created_at']
company.updated_at = companies['updated_at']
company.server_at = now
count_company = company.where({'company_id': company.company_id})
if len(count_company) > 0 or company.deleted_at:
for data in count_company:
company.id = data['id']
if company.deleted_at:
company.delete()
else:
company.update_special()
else:
company.add_special()
company.close_connection()
if 'credits' in updates:
for credits in updates['credits']:
credit = Credit()
credit.credit_id = credits['id']
credit.employee_id = credits['employee_id']
credit.customer_id = credits['customer_id']
credit.amount = credits['amount']
credit.reason = credits['reason']
credit.status = credits['status']
credit.deleted_at = credits['deleted_at']