Thanks for the detailed explanation and the workarounds, works nicely.
2013/1/8 Michael Bayer mike...@zzzcomputing.com
assuming you can try 0.8 which provides inspect(), this will show what is
happening:
from sqlalchemy import inspect
print
p.children[2] = c2
print
Hi all!
I'm trying to use sqlalchemy.ext.orderinglist as per instructions here
http://docs.sqlalchemy.org/en/rel_0_8/orm/extensions/orderinglist.html ,
and but I've encountered a loss of data while trying to swap positions of
related records inside a related property list. I thought it was
On Jan 7, 2013, at 7:05 PM, Alexey Vihorev wrote:
p.children[1], p.children[2] = p.children[2], p.children[1]
print(p.children) #prints [Mary, Kenny, John]
yeah, without looking too deeply I'm fairly certain this is this trac ticket:
http://www.sqlalchemy.org/trac/ticket/1103
Tried to replace this with this, but results are the same
temp1 = p.children[1]
temp2 = p.children[2]
p.children[2] = temp1
p.children[1] = temp2
From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On
Behalf Of Michael Bayer
Sent: Tuesday, January 08, 2013 2:23 AM
assuming you can try 0.8 which provides inspect(), this will show what is
happening:
from sqlalchemy import inspect
print
p.children[2] = c2
print p.children
print inspect(c2).attrs.parent.history
print inspect(c3).attrs.parent.history
print