Re: [sqlalchemy] Composite column with null property

2017-05-12 Thread mike bayer
you would need to use the "on load" events to detect this and replace the value with None using set_committed_value() from sqlalchemy.orm import set_committed_value from sqlalchemy import event @event.listens_for(MyClass, "load") @event.listens_for(MyClass, "refresh") def

Re: [sqlalchemy] Composite column with null property

2017-05-12 Thread Simon King
On Thu, May 11, 2017 at 6:18 PM, wrote: > Hello, > > I have a Money composite column, comprised of an `amount` (Decimal) and a > `currency` (String). Sometimes the amount needs to be NULL, but then I get > an instance of Money(None, 'GBP'). Is there any way to force the