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


Python User.get_by_email方法代码示例

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


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

示例1: user_blogs

# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import get_by_email [as 别名]
def user_blogs(user_id=None):
    if user_id is not None:
        user = User.get_by_id(user_id)
    else:
        user = User.get_by_email(session['email'])
    blogs = user.get_blogs()
    return render_template('user_blogs.html', blogs=blogs, email=user.email)
开发者ID:leverage2014,项目名称:python_web_blog,代码行数:9,代码来源:app.py

示例2: tester_method

# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import get_by_email [as 别名]
def tester_method():

    email=request.form['email']
    print(email)
    user=User.get_by_email(email)
    Database.update("users",{"email":email},{"printdata":"no"})
    return "done"
开发者ID:hg0605,项目名称:iprint,代码行数:9,代码来源:app.py

示例3: test_method

# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import get_by_email [as 别名]
def test_method():
    email=request.form['email']
    print(email)
    user=User.get_by_email(email)
    print (user.json())
    k=user.json()
    k['_id']=str(k['_id'])
    return jsonify({"status":k['printdata']})
开发者ID:hg0605,项目名称:iprint,代码行数:10,代码来源:app.py

示例4: create_new_blog

# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import get_by_email [as 别名]
def create_new_blog():
    if request.method=='GET':
        return render_template('new_blog.html')
    else:
        title=request.form['title']
        description=request.form['description']
        user=User.get_by_email(session['email'])
        blog=Blog(user.email,title,description,user._id)
        blog.save_to_mongo()
        return make_response(user_blogs(user._id))
开发者ID:nupurbaghel,项目名称:nupur-blog,代码行数:12,代码来源:app.py

示例5: create_new_post

# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import get_by_email [as 别名]
def create_new_post(blog_id):
    if request.method=='GET':
        return render_template('new_post.html',blog_id=blog_id)
    else:
        title=request.form['title']
        content=request.form['content']
        user=User.get_by_email(session['email'])
        new_post=Post(blog_id,title,content,user.email)
        new_post.save_to_mongo()
        return make_response(blog_posts(blog_id))
开发者ID:nupurbaghel,项目名称:nupur-blog,代码行数:12,代码来源:app.py

示例6: create_new_blog

# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import get_by_email [as 别名]
def create_new_blog():
    #user came in directly from a url; so show them the create new from
    if request.method == 'GET':
        return render_template('new_blog.html')
    else:
        title= request.form['title']
        description= request.form['description']
        user = User.get_by_email(session['email'])

        new_blog=Blog(user.email, title, description, user._id)
        new_blog.save_to_mongo()
        #the below returns or calls user_blogs
        return make_response(user_blogs(user._id))
开发者ID:ibininja,项目名称:blpymo,代码行数:15,代码来源:app.py

示例7: create_new_post

# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import get_by_email [as 别名]
def create_new_post(blog_id):
    #user came in directly from a url; so show them the create new from
    if request.method == 'GET':
        return render_template('new_post.html', blog_id=blog_id)
    else:
        title= request.form['title']
        content= request.form['content']
        user = User.get_by_email(session['email'])

        new_post = Post(blog_id, title, content, user.email)
        new_post.save_to_mongo()
        print(blog_id)
        #the below returns or calls user_blogs
        return make_response(blog_posts(blog_id))
开发者ID:ibininja,项目名称:blpymo,代码行数:16,代码来源:app.py

示例8: eigth_question

# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import get_by_email [as 别名]
def eigth_question():
    email = session['email']
    username = User.get_by_email(email)
    return render_template('ques8.html', user = username.email, id = username.score_id)
开发者ID:rohit-136,项目名称:Sherlock_partial,代码行数:6,代码来源:app.py

示例9: get_all_scores

# 需要导入模块: from src.models.user import User [as 别名]
# 或者: from src.models.user.User import get_by_email [as 别名]
def get_all_scores(_id):
    email = session['email']
    username = User.get_by_email(email)
    scores = Score.get_from_mongo_score(_id)
    return render_template('score_list.html', scores = scores, user = username.email, id = username._id)
开发者ID:rohit-136,项目名称:Sherlock_partial,代码行数:7,代码来源:app.py


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