Re: [sqlalchemy] Is there an event hook for putting a class into class_registry?

2021-10-08 Thread Mike Bayer
On Fri, Oct 8, 2021, at 4:13 PM, niuji...@gmail.com wrote: > Thanks for this very important information! > > If I do want to utilize the mapper functions at this stage, what can I do? > currently I have this error showing up: > > AttributeError: 'Mapper' object has no attribute

Re: [sqlalchemy] Is there an event hook for putting a class into class_registry?

2021-10-08 Thread niuji...@gmail.com
Thanks for this very important information! If I do want to utilize the mapper functions at this stage, what can I do? currently I have this error showing up: AttributeError: 'Mapper' object has no attribute '_columntoproperty' On Friday, October 8, 2021 at 6:58:02 AM UTC-7 Mike Bayer wrote:

Re: [sqlalchemy] Is there an event hook for putting a class into class_registry?

2021-10-08 Thread Mike Bayer
On Fri, Oct 8, 2021, at 7:09 AM, niuji...@gmail.com wrote: > In order to make sure that the mapped class is fully ready, I chose the > latest point, namely `class_instrument`. > However, it seems that at that moment the `__mapper__` attribute is not > available. > When I tried > return

Re: [sqlalchemy] Is there an event hook for putting a class into class_registry?

2021-10-08 Thread niuji...@gmail.com
In order to make sure that the mapped class is fully ready, I chose the latest point, namely `class_instrument`. However, it seems that at that moment the `__mapper__` attribute is not available. When I tried return cls.__mapper__.get_property_by_column(column_obj).key I got: