Re: [Sqlalchemy-users] Class Inheritance / Polymorphism

2006-03-26 Thread Michael Carter
Great, I'll check out the latest revision. There was another issue that I ran into a couple hours ago. That is, if you turn database echo on for the test2 example you can see that every time you make a call like Test.get(1) or Test.get(2) the object is reloaded from the database. I believe that

Re: [Sqlalchemy-users] Re: Retrofitting database back end

2006-03-26 Thread Jonathan Ellis
On 3/25/06, Jonathan Hayward http://JonathansCorner.com [EMAIL PROTECTED] wrote:A few questions:1: How do I specify a string of indeterminate length in the pseudocode at the bottom of this list? It will be a usability bug if I setarbitrary limits on how long things can be?Just don't specify a

[Sqlalchemy-users] caching

2006-03-26 Thread Florian Boesch
Seemingly SA is fairly liberal with interpreting my wish to get stuff from the database. So what's the pattern to deal with session caching? I hear there's expunge etc. now, and expire, but that's all when I know what objects I want to have removed/expired/refreshed. Fact is, I don't, I wouldn't

Re: [Sqlalchemy-users] Re: Retrofitting database back end

2006-03-26 Thread Jonathan Hayward http://JonathansCorner.com
On 3/26/06, Jonathan Ellis [EMAIL PROTECTED] wrote: On 3/25/06, Jonathan Hayward http://JonathansCorner.com [EMAIL PROTECTED] wrote: A few questions:1: How do I specify a string of indeterminate length in the pseudocode at the bottom of this list? It will be a usability bug if I setarbitrary

[Sqlalchemy-users] Return lists in mapping

2006-03-26 Thread Koen Bok
When I make a selection with a mapper I get back an instance object. Same goes for the mapper's relations.Is there any way to make SQLAlchemy returning standard list objects?Example:orders = list()print type(orders) #type 'list'orders = Order.mapper.select(limit=3)print type(orders)print

Re: [Sqlalchemy-users] SQLObject and SQLAlchemy

2006-03-26 Thread David Geller
I realize that this is up to Ian, and I know he has some problems with certain aspects of SA architecture, but doesn't it make sense for there to be a SO compatibility layer to SA, rather then continuing a completely separate SO? This, since it seems SO performs a subset of what SA is capable

Re: [Sqlalchemy-users] cascade_mapper does not support multiple joins

2006-03-26 Thread Michael Bayer
im not a huge fan of cascade_mapper for reasons like this. since you have an ambiguous join, perhaps youre looking for explicit join conditions ? http://www.sqlalchemy.org/docs/ adv_datamapping.myt#adv_datamapping_relations_customjoin On Mar 26, 2006, at 1:05 PM, Gambit wrote: Hi guys

Re: [Sqlalchemy-users] caching

2006-03-26 Thread Michael Bayer
theres no caching in SQLAlchemy. theres an identity map which has some of the same effects as a cache. basically, if you have already loaded your object into the current session, thats it. if you load it again, its going to use the same one you have, unless you clear the session, or

Re: [Sqlalchemy-users] Return lists in mapping

2006-03-26 Thread Michael Bayer
well other folks have been asking that it return a generator object which dynamically executes the query at the moment you ask for a slice of it.you can always go with orders = list(Order.mapper.select(limit=3)) to assure the type.any particular reason "list" is so important ?  whats python

Re: [Sqlalchemy-users] cascade_mapper does not support multiple joins

2006-03-26 Thread Gambit
I put into the wiki's recipe section a working version of all this, for those who are interested. Incidentally -- I know the join's ambiguous, but while we're guessing with cascade_mapper (that is, if it's going to be used as a feature), we might as well guess intelligently. Does the current

Re: [Sqlalchemy-users] caching

2006-03-26 Thread Florian Boesch
So how do you scale/split your application across multiple data accessing servers (short of writing an application server)? Calling objectstore.clear() everywhere? Quoting Michael Bayer [EMAIL PROTECTED]: theres no caching in SQLAlchemy. theres an identity map which has some of the same

Re: [Sqlalchemy-users] Return lists in mapping

2006-03-26 Thread Michael Bayer
On Mar 26, 2006, at 3:48 PM, Koen Bok wrote: Does indeed work, but orders[1].products is still an instance object. Is there a way to convert all of the relation results to lists? not really, since a plain list cannot track changes you have made to that list, and a plain list also does

Re: [Sqlalchemy-users] Return lists in mapping

2006-03-26 Thread Koen Bok
Ha! objectstore.commit() was where I all did it for! I will stick to the plan figuring how PyObjC decides what a list is. Then I will someway let it decide the mapper results are also lists. Thanks for your quick replies! Koen On 26-mrt-2006, at 23:02, Michael Bayer wrote: On Mar 26,

[Sqlalchemy-users] firebird connection - does autoload work?

2006-03-26 Thread Brad Clements
I am using 3.2 Kinterbasdb with latest svn sqlalchemy. I've defined tables using autoload, but primary_key = False in all the tables loaded. Also it doesn't seem to create foreign keys either. Anyone know if this is supposed to work with firebird? -- Brad Clements,[EMAIL

Re: [Sqlalchemy-users] firebird connection - does autoload work?

2006-03-26 Thread Michael Bayer
firebird doesnt work at all right now AFAIK...if it actually did some things correctly, thats great news. the creator/maintainer of the module has been on vacation until this week, and has not yet gotten around to the initial testing of the module which I committed into SVN for him a few

Re: [Sqlalchemy-users] (two other ways to totally disable) caching

2006-03-26 Thread Michael Bayer
this patch will cause the mapper to reload all the properties in identity-mapped objects every time a SELECT statement comes across it, blowing away any changes that might have been made to the object in memory. it maintains the unique per-session identity map of instances: Index:

Re: [Sqlalchemy-users] hibernate

2006-03-26 Thread Michael Bayer
On Mar 26, 2006, at 5:56 PM, Florian Boesch wrote: And yes, I'm also *SICK* of putting up with an endless stream of bugs that keep creeping up and slowing me down. SA was only released as an SVN checkout in November. its going to have a lot of bugs for many months. not like ive been

Re: [Sqlalchemy-users] hibernate

2006-03-26 Thread Michael Bayer
and anyway, SVN changeset 1216 : m = mapper(class, table, always_refresh=True) anytime that mapper pulls an already-loaded object from the identity map when traversing a rowset, it will overwrite the object's properties with the rowset's data. will blow away any changes on that

Re: [Sqlalchemy-users] Class Inheritance / Polymorphism

2006-03-26 Thread Michael Carter
It seems that this problem is giving me more trouble than I originally thought. If I create a many-to-many relation between the baseclass Test and some other class Foo to get the attribute foos, then it doesn't work with Test1 and Test2 instances. a = Test1(); a.foos.append(Foo());

Re: [Sqlalchemy-users] caching

2006-03-26 Thread Jonathan Ellis
On 3/26/06, Florian Boesch [EMAIL PROTECTED] wrote: So how do you scale/split your application across multiple data accessingservers (short of writing an application server)?What problems does an identity map pose to multiple client processes? I'm confused because you seem to imply that if you

Re: [Sqlalchemy-users] (two other ways to totally disable) caching

2006-03-26 Thread Jonathan Ellis
I'm really suspicious of this because the other ORM whose design I really admire, the Java SimpleORM, also has an identity map with no way to turn it off, and its author has put a hell of a lot of thought into it. FWIW. On 3/26/06, Michael Bayer [EMAIL PROTECTED] wrote: this patch will cause the

Re: [Sqlalchemy-users] (two other ways to totally disable) caching

2006-03-26 Thread Michael Bayer
Oh, i would never recommend turning off the identity mapthe second patch below is more for educational means, which is why I say its "definitely worth trying" - I was amazed at how fast things started to break down when i tried it.    having the mapper re-fetch the attributes on every select