當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。