On Jun 20, 2011, at 12:37 PM, Chris Withers wrote: > On 20/06/2011 17:27, Michael Bayer wrote: >>> So, multiple rows in the `ip` table end up mapping to a single user >>> objects. (ie: I end up with a sequence of ip addresses on user object) >>> >>> How do I do it? >> >> I would likely just map traditionally and have "User" be a non-mapped proxy >> object to a collection of "email/ip" objects. > > Any examples knocking around of this pattern?
heh, you're seeking some kind of magic that doesn't exist :) class User(object): def __init__(self, email): self.records = Session.query(IpEmailthing).filter_by(email=email).all() u = User("someemail") print "records ! ", u.records -- 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 sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.