Beispiel #1
0
 def current_session(cls) -> "SearchSession":
     """Get/create :class:`.SearchSession` for this context."""
     g = get_application_global()
     if not g:
         return cls.get_session()
     if "search" not in g:
         g.search = cls.get_session()  # type: ignore
     return g.search  # type: ignore
Beispiel #2
0
def current_session() -> SearchSession:
    """Get/create :class:`.SearchSession` for this context."""
    g = get_application_global()
    if not g:
        return get_session()
    if 'search' not in g:
        g.search = get_session()  # type: ignore
    return g.search  # type: ignore
Beispiel #3
0
def current_session() -> FulltextSession:
    """Get/create :class:`.FulltextSession` for this context."""
    g = get_application_global()
    if not g:
        return get_session()
    if 'fulltext' not in g:
        g.fulltext = get_session()  # type: ignore
    return g.fulltext  # type: ignore
Beispiel #4
0
def current_session() -> DocMetaSession:
    """Get/create :class:`.DocMetaSession` for this context."""
    g = get_application_global()
    if not g:
        return get_session()
    elif 'docmeta' not in g:
        g.docmeta = get_session()   # type: ignore
    return g.docmeta    # type: ignore