Re: [sqlalchemy] Delegating to _declarative_constructor

2016-07-25 Thread Mike Bayer
On 07/25/2016 09:12 AM, Michael Williamson wrote: Hello! For one of our models, I've defined a custom implementation for `__init__`. Since it should largely behave the same as the default constructor, it delegates to `_declarative_constructor`, and then runs some extra code. However, this

[sqlalchemy] Delegating to _declarative_constructor

2016-07-25 Thread Michael Williamson
Hello! For one of our models, I've defined a custom implementation for `__init__`. Since it should largely behave the same as the default constructor, it delegates to `_declarative_constructor`, and then runs some extra code. However, this feels like relying on some of the internals of

Re: [sqlalchemy] Re: Execute with raw string not persisted to database

2016-07-25 Thread Simon King
Even when using the ORM you ought to be using session.commit() to commit transactions. If you've been using the ORM against MyISAM tables you can probably get away without it since MyISAM tables don't support transactions. Simon On Mon, Jul 25, 2016 at 1:31 PM, Rogier Eggers

Re: [sqlalchemy] Re: Execute with raw string not persisted to database

2016-07-25 Thread Rogier Eggers
Simon, Others, Thanks. Indeed the problem was the storage engine of the table. Thanks for that hint! I wonder however, is this problem to work with InnoDB specific to this raw execute interface of sqlalchemy? I have never come across the problem when using sqlalchemy as an ORM. Brgds,

Re: [sqlalchemy] Re: Execute with raw string not persisted to database

2016-07-25 Thread Simon King
...and the reason that it works on the older tables is probably that they use the MyISAM engine rather than InnoDB. On Mon, Jul 25, 2016 at 12:05 PM, Mehdi gmira wrote: > Maybe you forgot to commit ? > > > Le lundi 25 juillet 2016 12:08:17 UTC+2, Rogier Eggers a écrit : >> >>

[sqlalchemy] Re: Execute with raw string not persisted to database

2016-07-25 Thread Mehdi gmira
Maybe you forgot to commit ? Le lundi 25 juillet 2016 12:08:17 UTC+2, Rogier Eggers a écrit : > > Hello, > > I have an old script that I'm upgrading. It uses sqlalchemy connect and > then execute statements to send raw sql as strings to the database (mysql). > The problem that I'm having is

[sqlalchemy] Execute with raw string not persisted to database

2016-07-25 Thread Rogier Eggers
Hello, I have an old script that I'm upgrading. It uses sqlalchemy connect and then execute statements to send raw sql as strings to the database (mysql). The problem that I'm having is that an insert statement that I issue in this way is seemingly handled by sqlalchemy without problems (I

Re: [sqlalchemy] Leveled single table inheritance without declarative API [SOLVED]

2016-07-25 Thread Ameretat Reith
On Mon, 25 Jul 2016 01:37:10 -0400 Mike Bayer wrote: > On 07/25/2016 12:23 AM, Ameretat Reith wrote: > > > >>> mapper(Father1980,fathers,inherits=fathersMapper, > >>>polymorphic_identity='young-father') > >> > >> you have the wrong table above ("fathers" and