Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用非声明性 SQLAlchemy 设置,我可以在association_proxy无需修改模型类的情况下使用吗?
association_proxy
初步破解:
(在发生 SQLAlchemy 映射等的模块中:)
import ModelClass ModelClass.associationProperty = association_proxy() mapper() #etc..
这可行,但我不确定这有多可靠。