[docs]defrequest():"""Return the currently authorized User object. Returns: User object """returngetattr(_thread_locals,"request",None)
[docs]classThreadLocalsMiddleware:"""Stores the current authorized User object in thread locals for access in models (and elsewhere) without passing the user around as an argument."""