[sqlalchemy] Sqlalchemy, Postgres and SSL

2011-05-06 Thread mando
Hi, how can I set my sqlalchemy engine to connect to a postgres on remote setting the ssl mode as allow? Thanks a lot! Luca -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com. To

[sqlalchemy] eager loading and a self-referential composite primary key

2011-05-06 Thread Taavi Burns
We have a multi-tenant database that includes a heirarchical layout. We tried to apply subqueryloads across the board, but tests fail in this one case. class Folder(Base): __tablename__ = 'folder' __table_args__ = ( ForeignKeyConstraint(['accountid', 'parent'],

[sqlalchemy] Dynamic query

2011-05-06 Thread Enrico Morelli
Dear all, I've a form where people fill one or more fields to search in a db. For the moment I solve it using a lot of if statement and a lot of different query based on the filled fields. Something like that: if start_date and end_date and instrument and details and technician:

Re: [sqlalchemy] eager loading and a self-referential composite primary key

2011-05-06 Thread Taavi Burns
Okay, that's fair. I figured it was a bit pathological, even though it's a real-world use case. :) Sorry I didn't find #1401 in my searches. Wrong keywords! I'll see if I can find some time to write up a sqla test case out of my repro script. Too bad my netbook seems dead set on corrupting my

[sqlalchemy] deferred column sometimes lazily loaded, sometimes not

2011-05-06 Thread Bill Curtis
I put a breakpoint inside Session.query(), and I'm seeing some behavior that I don't understand. I'm using scoped_session() in my startup code, and calling Session.remove() in a finally block of my pylons base controller. This means that each web request should get a completely new SQAlchemy

Re: [sqlalchemy] Re: deferred column sometimes lazily loaded, sometimes not

2011-05-06 Thread Michael Bayer
On May 6, 2011, at 8:53 PM, Bill Curtis wrote: I think I have figured out what's going on here. request-1: 1.1) query runs, model object gets loaded 1.2) model object gets stuffed in session.identity map 1.3) model object gets stuffed in secondary beaker cache 1.4) deferred field gets

Re: [sqlalchemy] Sqlalchemy, Postgres and SSL

2011-05-06 Thread Michael Bayer
this would look like: e = create_engine(postgresql+psycopg2://scott:tiger@host/dbname, connect_args={'sslmode':'require'}) or e = create_engine(postgresql+psycopg2://scott:tiger@host/dbname?sslmode=require) SSL for psycopg2 is described at: