Could you describe what you are trying to achieve? There's nothing
about Mike's suggestion that means you need to create a new session -
you can reuse any existing session.

What does your CustomQueryCls do? Perhaps there's another way of doing
what you want?

Simon

On Tue, Jul 12, 2016 at 11:09 AM, Антонио Антуан <a.ch....@gmail.com> wrote:
> But it means that I should create one more session with one more connection
> to DB. This is not good for me :(
>
> понедельник, 11 июля 2016 г., 22:23:11 UTC+3 пользователь Антонио Антуан
> написал:
>>
>> Can I specify query_cls only for a one query? I try to change
>> query.session._query_cls and, of course, it doesn't  work...
>>
>> I want to perform something like this:
>>
>> query = Session.query(MyModel)...
>> default_querycls_result = query.all()
>> custom_querycls_result = query.change_query_cls(CustomQueryCls).all()
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to