UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Martijn Moeling
Update, (Still need help, I'm really puzzled on how to do this) since both Person and Company are polymorphic from Affiliation the relations are not really self referencing, So I need help defining the relation and a reference table. The reference table should however be something like this:

[sqlalchemy] passive_deletes=all still tries to query relationship on delete

2011-01-04 Thread Will
Hello, I noticed that when setting passive_deletes=all on a relationship and try to delete the parent object sqlalchemy still tries to query the child object. For the way my models are set up I can't have the child object be queried. I'm using a hybrid of horizontal and vertical sharding in

Re: [sqlalchemy] passive_deletes=all still tries to query relationship on delete

2011-01-04 Thread Michael Bayer
On Jan 4, 2011, at 8:58 AM, Will wrote: Hello, I noticed that when setting passive_deletes=all on a relationship and try to delete the parent object sqlalchemy still tries to query the child object. For the way my models are set up I can't have the child object be queried. I'm using a

Re: [sqlalchemy] passive_deletes=all still tries to query relationship on delete

2011-01-04 Thread Michael Bayer
ah you were right the first time. The all concept is local dependency.py, which just needs to interpret its internal values appropriately before sending arguments off to attributes.py. On Jan 4, 2011, at 10:49 AM, Will Weaver wrote: I made a different patch. This one I don't believe is

[sqlalchemy] migrating from 0.4 to 0.6 - PrimaryKeyConstraint.keys()

2011-01-04 Thread Moshe C.
What replaces the keys() method of PrimaryKeyConstraint that existed in 0.4 ? TIA -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to

Re: [sqlalchemy] migrating from 0.4 to 0.6 - PrimaryKeyConstraint.keys()

2011-01-04 Thread Michael Bayer
its there in all versions as constraint.columns.keys() or perhaps more portably [c.key for c in constraint] On Jan 4, 2011, at 12:03 PM, Moshe C. wrote: What replaces the keys() method of PrimaryKeyConstraint that existed in 0.4 ? TIA -- You received this message because you are

Re: UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Michael Bayer
Here is a demonstration program. If I understand correctly, ChildRelation is just the inverse of ParentRelation so backref can save you lots of configuration here: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base =

Re: [sqlalchemy] passive_deletes=all still tries to query relationship on delete

2011-01-04 Thread Will Weaver
Sweet thanks for the quick fix as always. On Tue, Jan 4, 2011 at 11:01 AM, Michael Bayer mike...@zzzcomputing.com wrote: ah you were right the first time.   The all concept is local dependency.py, which just needs to interpret its internal values appropriately before sending arguments off to

Re: UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Martijn Moeling
Michael, Thank you, reading trough your example (and running it) made me understand a bit more how SQLA works. I managed to get it all working, Since I was on my way to something a bit slightly more complex ...one last Question What if I would like to: Class RelationType(Base):

[sqlalchemy] Re: Not.How to do a not contains()

2011-01-04 Thread F.A.Pinkse
Hi Michael, Thanks for your swift answer. Had to find the right place for the ~ though to get it working under Elixir. .filter(~Person.address.contians(someaddress)) Thanks again you saved me a lot of searching. Frans. .Op 1/4/2011 5:02 PM, Michael Bayer schreef: The ~ symbol is

Re: UPDATE PLS HELP [sqlalchemy] Define a relation table

2011-01-04 Thread Michael Bayer
On Jan 4, 2011, at 2:34 PM, Martijn Moeling wrote: Michael, Thank you, reading trough your example (and running it) made me understand a bit more how SQLA works. I managed to get it all working, Since I was on my way to something a bit slightly more complex ...one last Question