[sqlalchemy] Re: Feature request: Session.get_local()

2007-03-20 Thread Daniel Miller
/orm/session.py . On Mar 12, 2007, at 9:21 PM, Daniel Miller wrote: def identity_key(self, *args, **kwargs): Get an identity key Valid call signatures: identity_key(class_, ident, entity_name=None) class_ - mapped class ident - primary key, if the key

[sqlalchemy] Re: Feature request: Session.get_local()

2007-03-12 Thread Daniel Miller
trivial though. ~ Daniel On Mar 10, 8:27 pm, Daniel Miller [EMAIL PROTECTED] wrote: Michael Bayer wrote: my only concern is that you now have more than one way to do it. i need to deal with things in the identity map. do i go look at the session.identity_map ? (which is documented, its

[sqlalchemy] Re: Feature request: Session.get_local()

2007-03-10 Thread Daniel Miller
Michael Bayer wrote: my only concern is that you now have more than one way to do it. i need to deal with things in the identity map. do i go look at the session.identity_map ? (which is documented, its part of the public API) oh no, i dont have the exact kind of key to use, now i have to

[sqlalchemy] Re: postgres and server_side_cursors

2007-01-24 Thread Daniel Miller
On Jan 23, 2007, at 10:06 PM, Daniel Miller wrote: I think I was the original person who had this problem. I found a bit of time to troubleshoot it and came up with a patch. The problem seems to be in ResultProxy when it does the metadata = cursor.description bit. cursor.description

[sqlalchemy] Re: postgres and server_side_cursors

2007-01-23 Thread Daniel Miller
I think I was the original person who had this problem. I found a bit of time to troubleshoot it and came up with a patch. The problem seems to be in ResultProxy when it does the metadata = cursor.description bit. cursor.description is returning None because the cursor has not had any rows

[sqlalchemy] Re: new docs new docs new docs

2007-01-22 Thread Daniel Miller
Ladies and Gentlemen: I present to you Michael Bayer, the amazing multitalented developer of SQLAlchemy--getting more done in one week than the average team of developers does in a month!! Not only is he a very fast coder, but he writes comprehensive documentation for his code--an

[sqlalchemy] Re: Regression between r2168 and HEAD

2007-01-13 Thread Daniel Miller
() statement, which will make it use cursors in the default manner. On Jan 11, 2007, at 8:58 AM, Daniel Miller wrote: import sqlalchemy as sa class Version(object): table = sa.Table(version, meta, sa.Column(id, mu.String, primary_key=True), sa.Column(number, mu.String

[sqlalchemy] Regression between r2168 and HEAD

2007-01-11 Thread Daniel Miller
After updating to HEAD this morning I got an error. This code has worked with many versions of SA and I've never seen anything like this error before. Here's the relevant code (modified from its original version to fit your screen): import sqlalchemy as sa class Version(object):

[sqlalchemy] Re: [Sqlalchemy-users] named cursor

2007-01-10 Thread Daniel Miller
Hi Mike, I've been lurking here in the shadows for a while...this particular topic looks very interesting to me and I'd love to upgrade to HEAD to try it out. However, I'm wondering what the risk factor is in doing that? Have there been any other major (potentially destabilizing) changes

[sqlalchemy] PickleType with custom pickler

2006-12-07 Thread Daniel Miller
I just looked at SA's PickleType and came up with a couple of issues. 1. dumps/loads It looks like you can provide a custom pickler to PickleType, but the Python Pickler class does not have dumps()/loads() methods. Those methods are only available at the module level. This is a minor issue

[sqlalchemy] SA 0.3.x: performance issues

2006-12-02 Thread Daniel Miller
Michael Bayer wrote: you need to forward the *actual test program* which you are running. i have tests for performance which generally show very minute speed differences between 0.2 and 0.3. The logging statements can be sped up by making them conditional and maybe removing some. I've

[sqlalchemy] Re: SA 0.3.x: performance issues

2006-12-02 Thread Daniel Miller
Michael Bayer wrote: also, I challenge your assertion that saying x and y or z is a perlish thing (its a C and Java thing if anything); python 2.5 has just added the y if x else z syntax which is essentially an official version of the same thing. Well, I wasn't really talking about 'x and

[sqlalchemy] Re: Cascade performance

2006-11-29 Thread Daniel Miller
Michael Bayer wrote: i doubt this was any faster in previous releases since the basic metholodgy of cascade hasnt changed Probably wasn't, I've just been testing with larger data sets lately. so ive added your test with an extra assertion that the session in fact contains 611 instances to

[sqlalchemy] Re: Cascade performance

2006-11-28 Thread Daniel Miller
Daniel Miller wrote: Lately I've been noticing severe slowness when instantiating new SA objects... Oh yeah, I forgot to mention that many of my class constructors take a parent object as one of their arguments, which explains the slow instantiation. cascade_test.py demonstrates

[sqlalchemy] Re: Constructing where-clauses dynamically

2006-11-11 Thread Daniel Miller
BTW, this post started out as a reply to James but grew into a collective summary of my thoughts on the entire thread so far. You've been warned :) James Taylor wrote: But wouldn't the join from orders to items be OUTER in this case since you can have orders with a total 50 but no items.

[sqlalchemy] Re: Constructing where-clauses dynamically

2006-11-09 Thread Daniel Miller
Michael Bayer wrote: but what happens if i say: q.select(or_(User.c.orders.items.item_name == 'item#4', User.c.orders.items.item_name == 'item #5')) if we naively convert c.orders.items.item_name=='item #4' into user.user_id=orders.user_id and orders.order_id=items.order_id and

[sqlalchemy] Re: Constructing where-clauses dynamically

2006-11-08 Thread Daniel Miller
Michael Bayer wrote: ok let me rephrase that... i have concerns. i think the concerns could be addressed, and we might be able to add this kind of feature...but i dont want to rush into it singlehandedly. I won't blame you for that. I'll help out as much as possible given my busy