[sqlalchemy] Re: Creating a polymorphic object?

2009-12-07 Thread jgarbers
On Dec 7, 11:18 am, "Michael Bayer" wrote: > it seems like you basically want access to the dictionary of type->class. >  You can get this off the base mapper (i.e. class_mapper(BaseClass) ) in a > dictionary called "polymorphic_map". Ah, thank you - exactly what I needed. It took me a moment to

Re: [sqlalchemy] Re: how to change a database

2009-12-07 Thread Peter
chris e wrote: > As far as the creation I'm no help, but I have done something similar > by connecting to different schemas in oracle. By setting the schema > argument on your table objects, you can bind them to a particular > database(schema), by changing the value of the schema argument, you > ca

Re: [sqlalchemy] Re: Cascading rules

2009-12-07 Thread Michael Bayer
kwarg wrote: > It's not just a single flag - it's a flag on a "particular" side of > the relationship > and in conjunction with "appropriate" set of cascade parameters that's > suitable > for my case. It's on the side of the relationship that manages the parent-child nature of the foreign key, whe

[sqlalchemy] Re: Cascading rules

2009-12-07 Thread kwarg
It's not just a single flag - it's a flag on a "particular" side of the relationship and in conjunction with "appropriate" set of cascade parameters that's suitable for my case. On Dec 7, 11:14 am, Michael Bayer wrote: > On Dec 7, 10:02 am, kwarg wrote: > > > Thanks, bojanb. > > The patch kinda

Re: [sqlalchemy] Creating a polymorphic object?

2009-12-07 Thread Michael Bayer
jgarbers wrote: > I'm using SQLAlchemy's declarative mode with polymorphic > relationships, so I have a base Node class along with several child > classes (ListNode, FileNode, etc.) A polymorphic_identity in the Node > table determines the class of object being loaded (node_type = 'list', > 'file'

[sqlalchemy] Re: Cascading rules

2009-12-07 Thread Michael Bayer
On Dec 7, 10:02 am, kwarg wrote: > Thanks, bojanb. > The patch kinda worked - after some trying I guessed the magic > combination of cascade,passive_deletes > and bakref placement on one instance. But it doesn't work on other > relationship - looks like I'd have to play > try-fail-guess game aga

[sqlalchemy] Creating a polymorphic object?

2009-12-07 Thread jgarbers
I'm using SQLAlchemy's declarative mode with polymorphic relationships, so I have a base Node class along with several child classes (ListNode, FileNode, etc.) A polymorphic_identity in the Node table determines the class of object being loaded (node_type = 'list', 'file', etc.). Each child class

[sqlalchemy] Re: Cascading rules

2009-12-07 Thread kwarg
Thanks, bojanb. The patch kinda worked - after some trying I guessed the magic combination of cascade,passive_deletes and bakref placement on one instance. But it doesn't work on other relationship - looks like I'd have to play try-fail-guess game again. To the authors of SQLAlchemy - why is it so