Re: [sqlalchemy] Wrong todo.id after the commit (a log string instead 1)

2016-08-26 Thread Mike Bayer
On 08/26/2016 05:55 PM, Simon King wrote: On 26 Aug 2016, at 21:42, adaptable (Metaframework) wrote: Hi all, this comment on Github is well formatted: https://github.com/zzzeek/sqlalchemy/pull/295#issuecomment-242834334 I see the wrong todo.id after the commit (a

Re: [sqlalchemy] Wrong todo.id after the commit (a log string instead 1)

2016-08-26 Thread Mike Bayer
On 08/26/2016 04:42 PM, adaptable (Metaframework) wrote: Hi all, this comment on Github is well formatted: https://github.com/zzzeek/sqlalchemy/pull/295#issuecomment-242834334 I see the wrong |todo.id| after the commit (a log string instead |1|) | |[...] 2016-08-2621:36:56,071INFO

Re: [sqlalchemy] Wrong todo.id after the commit (a log string instead 1)

2016-08-26 Thread Simon King
> On 26 Aug 2016, at 21:42, adaptable (Metaframework) > wrote: > > Hi all, > this comment on Github is well formatted: > > https://github.com/zzzeek/sqlalchemy/pull/295#issuecomment-242834334 > > I see the wrong todo.id after the commit (a log string instead 1) > >

[sqlalchemy] Wrong todo.id after the commit (a log string instead 1)

2016-08-26 Thread adaptable (Metaframework)
Hi all, this comment on Github is well formatted: https://github.com/zzzeek/sqlalchemy/pull/295#issuecomment-242834334 I see the wrong todo.id after the commit (a log string instead 1) [...] 2016-08-26 21:36:56,071 INFO sqlalchemy.engine.base.Engine COMMIT # before commit - id: None

Re: [sqlalchemy] bulk_save_objects can't save updated object having a versioning field

2016-08-26 Thread Mike Bayer
versioning is untested with the session.bulk() methods, a patch for the update is at https://bitbucket.org/zzzeek/sqlalchemy/issues/3781/implement-version_id-for-bulk_save. Also, your test needs to read like this: tmp = session.query(Test).filter(Test.id == 1).one() session.close()

Re: [sqlalchemy] Checking for an object in the database before adding a potential duplicate

2016-08-26 Thread Mike Bayer
On 08/25/2016 06:55 PM, Kovas Palunas wrote: Hi everyone, I have an database setup where i have two tables/objects that are associated via two many to many relationships (with association tables). I would like to find a way to quickly query for the existence of one of the objects, which is

[sqlalchemy] bulk_save_objects can't save updated object having a versioning field

2016-08-26 Thread Adrin Jalali
I've asked the question here (http://stackoverflow.com/questions/38969406/sqlalchemy-bulk-save-objects-cant-save-updated-object-having-a-versioning-field), but since I didn't receive answers, here's a copy. I suspect it might be a bug, but as sqlalchemy newbie I'd like to hear your feedback.

Re: [sqlalchemy] setters and getters on an automapped table

2016-08-26 Thread Simon King
On Fri, Aug 26, 2016 at 2:24 AM, Robert Minsk wrote: > I am using automap_base to reflect a table. > > metadata = MetaData() > metadata.reflect(bind=engine, only=['hosts']) > automap = automap_base(metadata=metadata) > automap.prepare() > > Hosts = automap.classes.hosts > > The