Re: [sqlalchemy] Rename attributes in autogenerated class

2019-10-14 Thread Mike Bayer
Hi there - you might have better luck asking on their tracker at https://github.com/agronholm/sqlacodegen in case people on here don't have sqlacodegen experience. On Mon, Oct 14, 2019, at 5:34 PM, Vishani Kankariya wrote: > Is it possible to rename columns in the classes that sqlacodegen

[sqlalchemy] Rename attributes in autogenerated class

2019-10-14 Thread Vishani Kankariya
Is it possible to rename columns in the classes that sqlacodegen generates from a database? -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See

Re: [sqlalchemy] delete of polymorphic objects leaves orphaned parent objects

2019-10-14 Thread Mike Bayer
like Simon wrote, we would need more detail on the exact query and how you came up with it, in the original example it refers to an ItemGroup object "ig", is that the object that may have been deleted, is there a stack trace, etc. If you can just put together a script that has the minimal

Re: [sqlalchemy] delete of polymorphic objects leaves orphaned parent objects

2019-10-14 Thread Simon King
I can't make a guess without a script to reproduce it I'm afraid. Sorry, Simon On Mon, Oct 14, 2019 at 8:35 AM natsjoo sodillepa wrote: > > Ok, > > I have managed to get rid of the problem, but I'm don't like what is > happening. > Solution: remove a secondary relation from the model: > >

Re: [sqlalchemy] mssql+turbodbc cnnection not working when converted to .exe , however runs fine when it is in .py file

2019-10-14 Thread Simon King
Looks like you need to convince PyInstaller to include the turbodbc library in your executable. This would be a PyInstaller question rather than an SQLAlchemy one. I haven't used PyInstaller, but typically these tools analyse your source code to see which modules you are importing, and include

Re: [sqlalchemy] delete of polymorphic objects leaves orphaned parent objects

2019-10-14 Thread natsjoo sodillepa
Ok, I have managed to get rid of the problem, but I'm don't like what is happening. Solution: remove a secondary relation from the model: model = relationship("Model", secondary='item_group', uselist=False) After this, the following code does do a proper delete of the items: for it in