开发者

Constant property/column value for objects in SQLAlchemy

i have a class

class User:
    constant_value = 5

when i use "mapper" the property goes away. how do i preserve this?开发者_如何学JAVA


Use exclude_properties:

mapper(Address, addresses_table,
            exclude_properties=['street', 'city', 'state', 'zip'])
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜