[sqlalchemy] Re: Questions about "session"

2010-06-02 Thread Az
Also: I'm using [Python 2.6.5] and [SQLAlchemy 0.5.8] Previously I was just shallow copying my dictionaries, and there were no issues then with my simulations. My dictionaries contain objects such that my students dictionary is basically: students[stud_id] = Student(stud_id, name, preferences,..

[sqlalchemy] Questions about "session"

2010-06-02 Thread Az
In my code, I am currently adding to the "session" in various modules (this is the same session since I'm importing it from my most prominent module). Some sample code would be: ## BEGIN CODE 1 ### Session = sessionmaker(bind=engine) session = Session() def addToTable(): """Very

[sqlalchemy] Re: multi-table comparators / properties - how?

2010-06-02 Thread SQLAlchemy User
On Jun 2, 6:43 am, Michael Bayer wrote: > On Jun 2, 2010, at 12:48 AM, SQLAlchemy User wrote: > > OK, I get the need for column_property, but the select is fairly > > complex and involves unions of the containing class (and it hasn't > > been defined yet). How do I get around this, and other qu

[sqlalchemy] Am I really doing this right?

2010-06-02 Thread Nick Retallack
I have a lot of questions, so bear with me. I've been having some doubts about whether I'm really using sqlalchemy in a good way. -- Is there any use case for having more than one session active in the same thread? Or does everyone use threadlocal sessions? If you bind different tables to diff

Re: [sqlalchemy] How to have query sent as a single line

2010-06-02 Thread Michael Bayer
very easy. throw in a ConnectionProxy, override cursor_execute(), strip newlines from the statements. On Jun 2, 2010, at 2:02 PM, Chris H. wrote: > Is there anyway to have sqlalchemy send the queries to the database as > a single line instead of multiline? The reason for this is we > generat

[sqlalchemy] How to have query sent as a single line

2010-06-02 Thread Chris H.
Is there anyway to have sqlalchemy send the queries to the database as a single line instead of multiline? The reason for this is we generate multiple GB of database logs each hour, and trying to find the rest of a given sqlalchemy query is quite a pain right now. It would be much easier for us i

Re: [sqlalchemy] Re: Help with optimizing

2010-06-02 Thread Michael Bayer
On Jun 2, 2010, at 1:47 PM, Jason Baker wrote: > On May 30, 8:39 pm, Michael Bayer wrote: >> OK well by re018792aea57 I've bumped the callcounts down a *little*, >> reducing compiler overhead within the flush(). Perhaps it will be a >> bigger difference for your app which seems to be heavy

[sqlalchemy] Re: Help with optimizing

2010-06-02 Thread Jason Baker
On May 30, 8:39 pm, Michael Bayer wrote: > OK well by re018792aea57 I've bumped the callcounts down a *little*, reducing > compiler overhead within the flush().     Perhaps it will be a bigger > difference for your app which seems to be heavy on flush() calls. As it turns out, that change didn'

[sqlalchemy] Re: non_primary mapper or mixin or ??

2010-06-02 Thread ObjectEvolution
Hi Michael, I apologize for being so confusing; here's a restatement of the thing I'm trying to solve: I'm working on a web publishing system for a client. The project has a BASE table which contains all the base objects and has a column called DELETED with a value of 0 or 1. We created the view,

Re: [sqlalchemy] SA-SID issue

2010-06-02 Thread Michael Bayer
the behavior here is exactly that which I described at http://groups.google.com/group/sqlalchemy/msg/ab479d4762c24c65 . The presence of the slash invokes the usage of cx_oracle makedsn(), in this case with a blank dsn, whereas when not, sends the hostname "localhost" as the DSN argument direct

[sqlalchemy] SA-SID issue

2010-06-02 Thread dhanil anupurath
Hi I am using Oracle with SQLalchemy in my application. 1. The SQLalchemy documentation gives the following as the connect string for Oracle sqlalchemy.url=oracle://user:passw...@localhost:1521/ SID_name 2. The above connect string does not seem to work in my application.

Re: [sqlalchemy] Re: multi-table comparators / properties - how?

2010-06-02 Thread Michael Bayer
On Jun 2, 2010, at 12:48 AM, SQLAlchemy User wrote: > OK, I get the need for column_property, but the select is fairly > complex and involves unions of the containing class (and it hasn't > been defined yet). How do I get around this, and other questions > below > > I think I got the SQL rig