On Mon, Mar 11, 2019 at 3:59 AM Tolstov Sergey <whistler...@gmail.com> wrote:
>
> Can i override handler for this error?
> Example is - >
>   1) defined only Parent class
>   2) session.query(Parent)
>   -- > raised Exceptions
>
> Resolutions:
>   1) try_except for all_queries (too much entry points)
>   2) load all possible classes (low perfomance)
>
> How can i override /sqlalchemy/orm/loading.py
>   configure_subclass_mapper on runtime?

If you are loading a Parent class, and the row indicates that it is in
fact a Child class, then that mapper must be present.    What would
this custom handler do exactly, run a whole module import inside the
loading process?   I'm not sure that's threadsafe in any case.    if
your program runs long enough, all of those mappings would have been
loaded in any case I'm not sure I understand what the problem is.



>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> 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.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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