def METHOD_NAME(self, query_cls=None):
    """return a class property which produces a :class:`.Query` object
    against the class and the current :class:`.Session` when called.
    e.g.::
        Session = scoped_session(sessionmaker())
        class MyClass(object):
            query = Session.query_property()
        # after mappers are defined
        result = MyClass.query.filter(MyClass.name=='foo').all()
    Produces instances of the session's configured query class by
    default.  To override and use a custom implementation, provide
    a ``query_cls`` callable.  The callable will be invoked with
    the class's mapper as a positional argument and a session
    keyword argument.
    There is no limit to the number of query properties placed on
    a class.
    """
    class query(object):
        def __get__(s, instance, owner):
            try:
                mapper = class_mapper(owner)
                if mapper:
                    if query_cls:
                        # custom query class
                        return query_cls(mapper, session=self.registry())
                    else:
                        # session's configured query class
                        return self.registry().query(mapper)
            except orm_exc.UnmappedClassError:
                return None
    return query()