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
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
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:
>
>
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,