Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-20 Thread Michael Bayer
On Jul 19, 2006, at 9:36 PM, Daniel Miller wrote: > > Well right, and that's what I ended up doing. But I sort of think > the p.children collection will still try to update the relationship > if it gets modified, which would cause problems in my case. That's > why we might need to implement

Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-19 Thread Daniel Miller
Michael Bayer wrote: > > On Jul 18, 2006, at 11:18 PM, Daniel Miller wrote: > >> Take a look at this example in the Hibernate documentation: >> >> http://www.hibernate.org/hib_docs/v3/reference/en/html/example-parentchild.html#example-parentchild-bidir >> >> >> ... >> > > right, but that impl

Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-18 Thread Michael Bayer
On Jul 18, 2006, at 11:18 PM, Daniel Miller wrote: > Take a look at this example in the Hibernate documentation: > > http://www.hibernate.org/hib_docs/v3/reference/en/html/example- > parentchild.html#example-parentchild-bidir > > Hibernate does not automatically add child to parent.children when

Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-18 Thread Daniel Miller
Michael Bayer wrote: > youre basically saying that Hibernate supports mutation operations > upon instrumented collections, without it needing to load the full > state of those collections from the database. how would this > support the add() method on Set (need to replace an existing item

Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-18 Thread Michael Bayer
i think you underestimate how destablizing and complicated this feature would really be. youre basically saying that Hibernate supports mutation operations upon instrumented collections, without it needing to load the full state of those collections from the database. how would this sup

Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-18 Thread Daniel Miller
Michael Bayer wrote: > > you might want to try: > > mapper (someclass, sometable, properties = { > 'rels' : relation(someotherclass, lazy=None) > }) > > which will turn off all loading on the "rels" attribute.im not sure > how well thats going to work since it hasnt

Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-18 Thread Michael Bayer
you might want to try: mapper (someclass, sometable, properties = { 'rels' : relation(someotherclass, lazy=None) }) which will turn off all loading on the "rels" attribute.im not sure how well thats going to work since it hasnt been tested ve

Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-17 Thread Daniel Miller
Michael Bayer wrote: > saying : > > rel.info = info > > implies that you are also saying: > > info.rels.append(rel) > > since "info" is saved to the database, and therefore can have any > number of Relation objects already in its "rels" collection, how > might SA properly appen

Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-17 Thread Michael Bayer
saying : rel.info = info implies that you are also saying: info.rels.append(rel) since "info" is saved to the database, and therefore can have any number of Relation objects already in its "rels" collection, how might SA properly append to the list without first lazily retre