Re: [sqlalchemy] Decoupling business and ORM model using dataclass(es)

2021-09-20 Thread Nikola Radovanovic
Thank you, I am reading Architecture Patterns with Python and trying to find a way to refactor our code to become maintainable. However I noticed that even with mapped dataclass there are problems like the one mentioned here

Re: [sqlalchemy] Decoupling business and ORM model using dataclass(es)

2021-09-20 Thread Mike Bayer
On Mon, Sep 20, 2021, at 5:04 AM, Nikola Radovanovic wrote: > > Hi, > When decoupling business from ORM model, dataclass passed to SA's imperative > mapper *map_imperatively* will receive SA's internals like for example > *_sa_instance_state* and *_sa_class_manager*. > > I am wondering, what

[sqlalchemy] Decoupling business and ORM model using dataclass(es)

2021-09-20 Thread Nikola Radovanovic
Hi, When decoupling business from ORM model, dataclass passed to SA's imperative mapper *map_imperatively* will receive SA's internals like for example *_sa_instance_state* and *_sa_class_manager*. I am wondering, what would be the best way to have "pure" dataclass, without SA internals?