SQLAlchemy中对象的常量属性/列值
我有一个类
class User:
constant_value = 5
当我使用“mapper”时,这个属性就消失了。我该怎么做才能保留它呢?
1 个回答
0
使用 exclude_properties:
mapper(Address, addresses_table,
exclude_properties=['street', 'city', 'state', 'zip'])