Re: [sqlalchemy] Association proxy in classical mapping keeping the business logic and the db schema separated

2017-07-24 Thread Mike Bayer
On Mon, Jul 24, 2017 at 4:40 AM, Ruben Di Battista wrote: > Thanks for taking the time to answer. > > Doing what you say means that then I have to import the models classes from > the sql.py module instead of the models.py. Am I right? your top example shows the model

Re: [sqlalchemy] Association proxy in classical mapping keeping the business logic and the db schema separated

2017-07-24 Thread Ruben Di Battista
Thanks for taking the time to answer. Doing what you say means that then I have to import the models classes from the *sql.py* module instead of the *models.py*. Am I right? Or the association_proxy attribute is then available to the original class (as it happens when using mapper)? I'm not

Re: [sqlalchemy] Association proxy in classical mapping keeping the business logic and the db schema separated

2017-07-23 Thread Mike Bayer
On Sun, Jul 23, 2017 at 11:26 AM, Ruben Di Battista wrote: > Hello, > > I'm trying to introduce database persistence into an already existent class > hierarchy. That mean I have in a separate module all the class representing > the models of my application (without SQL

[sqlalchemy] Association proxy in classical mapping keeping the business logic and the db schema separated

2017-07-23 Thread Ruben Di Battista
Hello, I'm trying to introduce database persistence into an already existent class hierarchy. That mean I have in a separate module all the class representing the models of my application (without SQL interaction methods), then I have in another module the SQL schema and the mapping (so I'm