On Sep 14, 2008, at 1:28 PM, GustaV wrote:
>
> I was thinking about something like:
> session.reload( [tile0, tile1, tile2], 'neighbors' ) for example.
> That feature would be great because you don't necessary know what
> relation you will need later when you do the first query (eagerload is
> not enough)
>
> or in the case:
> class Tile(object):
> @property
> def neighbors(self):
> return
> object_session(self).query(Tile).filter(Tile.id<self.id).all()
> have the possibility to query neighbors for many objects at a time.
"possible" yes, more verbose tho:
for t in [tile0, tile1, tile2]:
session.expire(t, ['neighbors'])
neighbor = aliased(Tile)
session.query(Tile).options(contains_eager("neighbors",
alias=neighbor)).outerjoin((neighbor, Tile.id<neighbor.id)).all()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---