本文整理汇总了Python中users.User.username方法的典型用法代码示例。如果您正苦于以下问题:Python User.username方法的具体用法?Python User.username怎么用?Python User.username使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类users.User
的用法示例。
在下文中一共展示了User.username方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: register
# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import username [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: sync_from_server
# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import username [as 别名]
#.........这里部分代码省略.........
transaction.tax = transactions['tax']
transaction.aftertax = transactions['aftertax']
transaction.credit = transactions['credit']
transaction.discount = transactions['discount']
transaction.total = transactions['total']
transaction.invoices = transactions['invoices'] if transactions['invoices'] else None
transaction.account_paid = transactions['account_paid']
transaction.account_paid_on = transactions['account_paid_on']
transaction.type = transactions['type']
transaction.last_four = transactions['last_four']
transaction.tendered = transactions['tendered']
transaction.transaction_id = transactions['transaction_id']
transaction.status = transactions['status']
transaction.deleted_at = transactions['deleted_at']
transaction.created_at = transactions['created_at']
transaction.updated_at = transactions['updated_at']
count_transaction = transaction.where({'trans_id': transaction.trans_id})
if len(count_transaction) > 0 or transaction.deleted_at:
for data in count_transaction:
transaction.id = data['id']
if transaction.deleted_at:
transaction.delete()
else:
transaction.update_special()
else:
transaction.add_special()
transaction.close_connection()
if 'users' in updates:
for users in updates['users']:
user = User()
user.user_id = users['id']
user.company_id = users['company_id']
user.username = users['username']
user.first_name = users['first_name']
user.last_name = users['last_name']
user.street = users['street']
user.suite = users['suite']
user.city = users['city']
user.state = users['state']
user.zipcode = users['zipcode']
user.email = users['email']
user.phone = users['phone']
user.intercom = users['intercom']
user.concierge_name = users['concierge_name']
user.concierge_number = users['concierge_number']
user.special_instructions = users['special_instructions']
user.shirt_old = users['shirt_old']
user.shirt = users['shirt']
user.delivery = users['delivery']
user.profile_id = users['profile_id']
user.payment_status = users['payment_status']
user.payment_id = users['payment_id']
user.token = users['token']
user.api_token = users['api_token']
user.reward_status = users['reward_status']
user.reward_points = users['reward_points']
user.account = users['account']
user.account_total = users['account_total']
user.credits = users['credits']
user.starch = users['starch']
user.important_memo = users['important_memo']
user.invoice_memo = users['invoice_memo']
user.role_id = users['role_id']
user.deleted_at = users['deleted_at']
user.created_at = users['created_at']