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

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)
Thread-local data

src/d/j/django-crum-0.6.1/crum/signals.py   django-crum(Download)
def _get_current_user_from_thread_locals(sender, **kwargs):
    """Signal handler to retrieve current user from thread locals."""
    from crum import _thread_locals
    return (getattr(_thread_locals, 'user', False), 10)
 
def _set_current_user_on_thread_locals(sender, **kwargs):
    """Signal handler to store current user on thread locals."""
    from crum import _thread_locals
    _thread_locals.user = kwargs['user']