当前位置: 首页>>代码示例>>Python>>正文


Python User.last_name方法代码示例

本文整理汇总了Python中models.user.User.last_name方法的典型用法代码示例。如果您正苦于以下问题:Python User.last_name方法的具体用法?Python User.last_name怎么用?Python User.last_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.user.User的用法示例。


在下文中一共展示了User.last_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: google_login

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import last_name [as 别名]
 def google_login(email, first, last):
     user1 = User()
     qry = User.query(User.email == email, User.first_name == first, User.last_name == last).get()
     logging.info(qry)
     if qry:
         return qry.key.id()
     else:
         user1.email = email
         user1.first_name = first
         user1.last_name = last
         token = user1.put()
         return token.id()
开发者ID:ItamarShDev,项目名称:attender-web,代码行数:14,代码来源:DAL.py

示例2: set_user_details

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import last_name [as 别名]
 def set_user_details(fb_id,  name, last_name, email):
     user1 = User()
     qry = user1.check_fb_logged_in(fb_id)
     if not qry:
         user1.fb_id = fb_id
         user1.first_name = name
         user1.last_name = last_name
         user1.email = email
         id = user1.put()
         return id.id()
     else:
         return qry.key.id()
开发者ID:ItamarShDev,项目名称:attender-web,代码行数:14,代码来源:DAL.py

示例3: register

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import last_name [as 别名]
 def register(email, hashed_password, first, last):
     user1 = User()
     qry = User.query(User.email==email, User.password==hashed_password, User.first_name==first, User.last_name==last).get()
     logging.info(qry)
     if qry:
         return 2
     qry = user1.check_user_exist_by_email(email)
     try:
         qry.password = hashed_password
         token = qry.put()
         return token.id()
     except:
         user1.email = email
         user1.password = hashed_password
         user1.first_name = first
         user1.last_name = last
         token = user1.put()
         return token.id()
开发者ID:ItamarShDev,项目名称:attender-web,代码行数:20,代码来源:DAL.py

示例4: get_user

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import last_name [as 别名]
def get_user(id=None):
    from models.user import UserSmallForm
    if 'logged_in' not in session:
        return redirect(url_for('welcome'))

    user = User(id=id)
    if request.method == 'POST':
        user.first_name = request.form.get('first_name', None)
        user.last_name = request.form.get('last_name', None)
        user.email = request.form.get('email', None)
        user.update_user()

    user = user.get_by_id()

    form = UserSmallForm(obj=user)

    schedule = Schedule(uid=id)
    schedules = schedule.get_by_logged_user(user.username, timeadapt=True)

    return render_template('user.html', user=user, form=form,
                           schedules=schedules)
开发者ID:acarmisc,项目名称:zombietweet,代码行数:23,代码来源:controller.py

示例5: print

# 需要导入模块: from models.user import User [as 别名]
# 或者: from models.user.User import last_name [as 别名]
#!/usr/bin/python3
import sys
import os
sys.path.insert(1, os.path.join(os.path.split(__file__)[0], '../../..'))

from models import storage
from models.base_model import BaseModel
from models.user import User

all_objs = storage.all()
print("-- Reloaded objects --")
for obj_id in all_objs.keys():
    obj = all_objs[obj_id]
    print(obj)

print("-- Create a new User --")
my_user = User()
my_user.first_name = "Betty"
my_user.last_name = "Holberton"
my_user.email = "[email protected]"
my_user.password = "root"
my_user.save()
print(my_user)
开发者ID:butcallmeJo,项目名称:airbnb_clone,代码行数:25,代码来源:test_save_reload_user.py


注:本文中的models.user.User.last_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。