[sqlalchemy] same code same database but the not same insert result

2014-07-08 Thread 'Frank Liou' via sqlalchemy
i use flask connect to postgres def post_insert(username): conn = engine.connect() encoded = base64.b64encode(username.encode('utf-8')) puresql = sqla.text("INSERT INTO friends(name) VALUES(:encoded)") conn.execute(puresql,encoded = encoded) i insert username encode with base64 t

Re: [sqlalchemy] postgresql large objects

2014-07-08 Thread Jonathan Vanasco
Working on this level of integration is way over my head, but I'd love to see this happen and wanted to quickly +1. I just had to refactor some code to store User Submitted Media into Postgres for background processing. While doing a bit of research, I learned that the streaming functionality

Re: [sqlalchemy] unit tests failing on 0.9.6

2014-07-08 Thread Mike Bayer
how are you running them? it isn't reporting any "failure", this seems like it's finding a bad test case. do you have any test.py type stuff it might be hitting? On 7/8/14, 5:56 PM, Jason Newton wrote: > Any thoughts on why the unit testing is failing? > > platform linux2 -- Python 2.7.6 -- p

[sqlalchemy] unit tests failing on 0.9.6

2014-07-08 Thread Jason Newton
Any thoughts on why the unit testing is failing? platform linux2 -- Python 2.7.6 -- py-1.4.20 -- pytest-2.5.2 -- /usr/bin/python == 5776 passed, 688 skipped in 139.77 seconds ===

Re: [sqlalchemy] advice sought : `commit()` without expiring from the session ?

2014-07-08 Thread Mike Bayer
you can make a new Session() with expire_on_commit=False, that can be from your sessionmaker. the settings you apply there override whats in the original factory. Though for status logging I tend to just use a separate Session/transaction for that, that way the main transaction can maintain atomi

[sqlalchemy] advice sought : `commit()` without expiring from the session ?

2014-07-08 Thread Jonathan Vanasco
I have a situation where I need to issue a `commit()` without expiring the object/attributes from the session. I'm in a `Celery` task, and need to log progress at certain points into a "status" column. the status points will be used to troubleshoot and "fix" jobs that didn't correctly complet

[sqlalchemy] Re: subquery? outer join with 3 tables

2014-07-08 Thread Jonathan Vanasco
Check out the docs for the `Association Proxy` - http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/associationproxy.html With that extension, you might be able to do everything within a relationship. -- You received this message because you are subscribed to the Google Groups "sqlalchemy"

Re: [sqlalchemy] subquery? outer join with 3 tables

2014-07-08 Thread Cornelius Kölbel
Am 08.07.2014 18:51, schrieb Jonathan Rogers: > On 07/08/2014 12:39 PM, Cornelius Kölbel wrote: >> Hi there, >> >> I am wondering how the following would be translated to sqlalchemy. >> >> I have three tables: >> >> "ClientMachine" >> "MachineToken" >> "Token" >> >> The table MachineTo

Re: [sqlalchemy] Modified mapping in composite association proxy causes conflict with persistent instance

2014-07-08 Thread Brian Findlay
Hmmm, must be a problem elsewhere. Sorry for wasting your time, Mike, but thanks for the test case. Donation enroute. On Tuesday, July 8, 2014 12:02:52 PM UTC-4, Michael Bayer wrote: > > a test case is attached, show me the failure please, thanks. > > > > On 7/8/14, 10:59 AM, Brian Findlay wrot

Re: [sqlalchemy] subquery? outer join with 3 tables

2014-07-08 Thread Jonathan Rogers
On 07/08/2014 12:39 PM, Cornelius Kölbel wrote: > Hi there, > > I am wondering how the following would be translated to sqlalchemy. > > I have three tables: > > "ClientMachine" > "MachineToken" > "Token" > > The table MachineToken acts as n:m mapping between "ClientMachine" and > "T

[sqlalchemy] subquery? outer join with 3 tables

2014-07-08 Thread Cornelius Kölbel
Hi there, I am wondering how the following would be translated to sqlalchemy. I have three tables: "ClientMachine" "MachineToken" "Token" The table MachineToken acts as n:m mapping between "ClientMachine" and "Token". Each machine can have several tokens assigned. Looks like this:

Re: [sqlalchemy] Modified mapping in composite association proxy causes conflict with persistent instance

2014-07-08 Thread Mike Bayer
a test case is attached, show me the failure please, thanks. On 7/8/14, 10:59 AM, Brian Findlay wrote: > Hi Mike, > > I'm using your variant on the 'unique object' recipe (see previous > posting http://goo.gl/I1buRz) with some composite association proxies. > Recently, the data I've been working

[sqlalchemy] Modified mapping in composite association proxy causes conflict with persistent instance

2014-07-08 Thread Brian Findlay
Hi Mike, I'm using your variant on the 'unique object' recipe (see previous posting http://goo.gl/I1buRz) with some composite association proxies. Recently, the data I've been working with introduced a duplicate in the property I've been using with attribute_mapped_collection(), so I'm trying