Re: [sqlalchemy] Duplicating a relationship from one ORM model to a subquery model

2023-09-07 Thread Mike Bayer
send viewonly=True to these relationships you make. these are not for writing anyway and that will resolve the overlaps warnings (the warning says as much). On Thu, Sep 7, 2023, at 10:41 AM, zedr...@gmail.com wrote: > Hi Mike, > > Thanks a lot for taking the time to reply… > > Indeed, I came

Re: [sqlalchemy] Duplicating a relationship from one ORM model to a subquery model

2023-09-07 Thread zedr...@gmail.com
Hi Mike, Thanks a lot for taking the time to reply… Indeed, I came to a similar conclusion and worked out what seems like a fairly clean way to copy relationships (assuming they do not use secondary_join). The fact that I cannot seem to update the mapper before the class is created makes my

Re: [sqlalchemy] Duplicating a relationship from one ORM model to a subquery model

2023-09-07 Thread Mike Bayer
On Thu, Sep 7, 2023, at 4:39 AM, zedr...@gmail.com wrote: > > *Is there a clean way to (programmatically) duplicate all relationship from > an existing model, over to a new model (that targets the same table and > selects a subset of columns as a subquery)?* relatonships are fixed to their