Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def current_request():
    """
    Retrieves the request from the current thread.
    """
    return getattr(_thread_local, "request", None)
        


src/m/e/Mezzanine-3.1.3/mezzanine/utils/sites.py   Mezzanine(Download)
 
from mezzanine.conf import settings
from mezzanine.core.request import current_request
 
 
    """
    from mezzanine.utils.cache import cache_installed, cache_get, cache_set
    request = current_request()
    site_id = getattr(request, "site_id", None)
    if request and not site_id:

src/m/e/Mezzanine-3.1.3/mezzanine/pages/tests.py   Mezzanine(Download)
from mezzanine.conf import settings
from mezzanine.core.models import CONTENT_STATUS_PUBLISHED
from mezzanine.core.request import current_request
from mezzanine.pages.models import Page, RichTextPage
from mezzanine.urls import PAGES_SLUG
        tertiary, created = secondary.children.get_or_create(title="Tertiary")
        # Force a site ID to avoid the site query when measuring queries.
        setattr(current_request(), "site_id", settings.SITE_ID)
 
        # Test that get_ascendants() returns the right thing.