Ok, another thing on the subject:

It looks like that does not work before a commit. Even a flush doesn't
help:

t1 = Tile(id=1)
t2 = Tile(id=2)
t3 = Tile(id=3)
t4 = Tile(id=4)
session.add_all([t1, t2, t3, t4])
session.flush()
assert t2.neighbors == [t1]

FAIL

I'd really like to use it before even a flush! :)


On Sep 10, 3:29 am, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Sep 9, 2008, at 7:27 PM, GustaV wrote:
>
>
>
> > t4 = session.query(Tile).get(4)
> > print t4.neighbors[0]._data
>
> > will print None
>
> you have to adjust the other mapping appropriately:
>
> related_tiles = mapper(Tile, tile_alias, non_primary=True, properties={
>      '_data':tile_alias.c.data
>
> })
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to