Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Return the request associated with the current thread.

        def get_current_request():
    """Return the request associated with the current thread."""
    return getattr(_thread_locals, 'request', None)
        


src/d/j/django-crum-0.6.1/crum/signals.py   django-crum(Download)
def _get_current_user_from_request(sender, **kwargs):
    """Signal handler to retrieve current user from request."""
    from crum import get_current_request
    return (getattr(get_current_request(), 'user', False), -10)
 
def _set_current_user_on_request(sender, **kwargs):
    """Signal handler to store current user to request."""
    from crum import get_current_request
    request = get_current_request()
    if request: