Skip to content

How to use SqlAlchmy @event.lesson_for()? #714

@rain-leiyu

Description

@rain-leiyu
  • GINO version:1.01
  • Python version:3.7
  • asyncpg version:0.20.1
  • aiocontextvars version:
  • PostgreSQL version:

Description

I wanted to trigger the sqlALchamy listener event, event.lesson_for, before the execution of gino Query, but it does not seem to be executed.

What I Did

@event.listens_for(Query, "before_compile", retval=True)
def before_compile_query(query):
    """A query compilation rule that will add limiting criteria for every
    subclass of HasPrivate"""

    print("query===========================")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions