Files
order/venv/Lib/site-packages/werkzeug/wrappers/user_agent.py
2019-07-17 16:36:59 +08:00

16 lines
444 B
Python

from ..utils import cached_property
class UserAgentMixin(object):
"""Adds a `user_agent` attribute to the request object which
contains the parsed user agent of the browser that triggered the
request as a :class:`~werkzeug.useragents.UserAgent` object.
"""
@cached_property
def user_agent(self):
"""The current user agent."""
from ..useragents import UserAgent
return UserAgent(self.environ)