[sqlalchemy] Re: Mapper properties and a callback

2007-12-22 Thread sdobrev
i'm not sure how much this would help u, but 0.4 has better support for your-own-collection-containers. see http://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_relation_collections e.g. subclass some list and u can do the callback at append() or whatever. Dave Harrison wrote: Hi

[sqlalchemy] Re: get mapped class

2007-12-22 Thread sdobrev
Alexandre da Silva wrote: I am already trying go get the list of mapped tables. I currently got a list from sqlalchemy.org.mapper from the weakref mapper_registry, but I don't know if that values are useful for my context. what u need? all tables? see metadata. all mappers? see the

[sqlalchemy] Re: Readonly objects/protecting objects from modifications

2007-12-22 Thread Michael Bayer
On Dec 22, 2007, at 12:34 AM, Andreas Jung wrote: --On 21. Dezember 2007 16:33:34 -0500 Michael Bayer [EMAIL PROTECTED] wrote: On Dec 21, 2007, at 3:13 PM, Rick Morrison wrote: I think the only way something like this should be done is as a test fixture which decorates classes

[sqlalchemy] Changing the type/class of an object using polymorphic tables in ORM

2007-12-22 Thread andresj
I don't know if I'm too clear, but I'll try to explain it. I'm using a set up similar to the one in http://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_mapper_inheritance_joined . I want to be able to change the type of an object. For example, in the example in the link above, I want to

[sqlalchemy] Re: Caching

2007-12-22 Thread Anton V. Belyaev
merge is working rudimentally for objects with unloaded scalar/ instance/collection attributes in r3974. whats not yet happening is the merging of the various query.options() that may be present on the original deferred loader, which means the merged instance wont necessarily maintain the

[sqlalchemy] Re: get mapped class

2007-12-22 Thread Alexandre da Silva
what u need? I need the list of mapped Classes, if mapper_registry have all classes I can use it. all tables? see metadata. all mappers? see the mapper_registry the relations inbetween? u have to dig the individual mappers, walk the polymorphisms and inheritances. I just want a list

[sqlalchemy] Re: Changing the type/class of an object using polymorphic tables in ORM

2007-12-22 Thread Michael Bayer
On Dec 22, 2007, at 3:27 PM, andresj wrote: I don't know if I'm too clear, but I'll try to explain it. I'm using a set up similar to the one in http://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_mapper_inheritance_joined . I want to be able to change the type of an object. For

[sqlalchemy] Re: Changing the type/class of an object using polymorphic tables in ORM

2007-12-22 Thread andresj
Thanks, I will use the approach you describe here when I get to that point in the development proccess :). So for now, your best bet is to issue the SQL directly to the database for the particular class change you want to do, remove the objects in question from the session using expunge(),

[sqlalchemy] Re: Making it possible to use custom properties in query.filter expressions.

2007-12-22 Thread andresj
On Dec 22, 5:07 pm, Michael Bayer [EMAIL PROTECTED] wrote: a synonym() is used so that your attributes are properly available in filter(). This functionality has been vastly improved in the current SVN trunk which resolves all the issues you outline above, and will be available in release