开发者

Constant property/column value for objects in SQLAlchemy

开发者 https://www.devze.com 2023-03-05 23:40 出处:网络
i have a class class User: constant_value = 5 when i use \"mapper\" the property goes away.how do i preserve this?开发者_如何学JAVAUse exclude_properties:

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

精彩评论

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