本文整理匯總了Python中models.Request.viewed方法的典型用法代碼示例。如果您正苦於以下問題:Python Request.viewed方法的具體用法?Python Request.viewed怎麽用?Python Request.viewed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Request
的用法示例。
在下文中一共展示了Request.viewed方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: process_request
# 需要導入模塊: from models import Request [as 別名]
# 或者: from models.Request import viewed [as 別名]
def process_request(self, request):
path_info = request.META['PATH_INFO']
exlude_list = [reverse('request-counter'),
reverse('admin:jsi18n'),
settings.MEDIA_URL,
settings.STATIC_URL]
if not any(url in path_info for url in exlude_list):
new_http_request = Request()
new_http_request.method = request.META['REQUEST_METHOD']
new_http_request.path_info = path_info
new_http_request.server_protocol = request.META['SERVER_PROTOCOL']
new_http_request.viewed = False
new_http_request.save()