Re: [sqlalchemy] fiddley mapping problem

2011-06-20 Thread Michael Bayer
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 ma

Re: [sqlalchemy] fiddley mapping problem

2011-06-20 Thread Chris Withers
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 collect

Re: [sqlalchemy] fiddley mapping problem

2011-06-20 Thread Michael Bayer
On Jun 20, 2011, at 12:21 PM, Chris Withers wrote: > Hi All, > > I have the following table: > > CREATE TABLE `ip` ( > `email` varchar(50) NOT NULL, > `ip` varchar(15) NOT NULL, > PRIMARY KEY (`email`,`ip`), > ) > > ...which I'm looking to map to the following class: > > class User: > >

[sqlalchemy] fiddley mapping problem

2011-06-20 Thread Chris Withers
Hi All, I have the following table: CREATE TABLE `ip` ( `email` varchar(50) NOT NULL, `ip` varchar(15) NOT NULL, PRIMARY KEY (`email`,`ip`), ) ...which I'm looking to map to the following class: class User: def __init__(self,email,*ips): self.email=email self.ips = ips So,