本文整理匯總了Python中vilya.models.user.User.get_current_user方法的典型用法代碼示例。如果您正苦於以下問題:Python User.get_current_user方法的具體用法?Python User.get_current_user怎麽用?Python User.get_current_user使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vilya.models.user.User
的用法示例。
在下文中一共展示了User.get_current_user方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: start_request
# 需要導入模塊: from vilya.models.user import User [as 別名]
# 或者: from vilya.models.user.User import get_current_user [as 別名]
def start_request(self, request):
SessionPublisher.start_request(self, request)
os.environ['SQLSTORE_SOURCE'] = request.get_url()
resp = request.response
resp.set_content_type('text/html; charset=utf-8')
resp.set_header('Pragma', 'no-cache')
resp.set_header('Cache-Control', 'must-revalidate, no-cache, private')
# FIXME: quixote with origin?
resp.set_header('Access-Control-Allow-Origin', '*')
request.enable_ajax = False
request.browser = request.guess_browser_version()
request.method = request.get_method()
request.url = request.get_path()
request.is_mobile = is_mobile_device(request)
request.start_time = time.time()
request.user = None
check_auth(request) # OAuth
if request.user is None:
request.user = User.get_current_user()
import_obj_set("request", request)
示例2: ttest_get_current_user
# 需要導入模塊: from vilya.models.user import User [as 別名]
# 或者: from vilya.models.user.User import get_current_user [as 別名]
def ttest_get_current_user(self): # noqa
assert not User.get_current_user()
示例3: test_get_current_user
# 需要導入模塊: from vilya.models.user import User [as 別名]
# 或者: from vilya.models.user.User import get_current_user [as 別名]
def test_get_current_user(self):
assert not User.get_current_user()