[sqlalchemy] Re: Error when trying to use a dict

2009-09-27 Thread BEES INC
phwoar, ok. I think I understand. To break it down: I have a class Foo which, among other things, contains a dict called vals with keys of dates and values of floats. When I store an instance of Foo, it goes to the foo table, and any items in the vals dict should go into the vals table. For

[sqlalchemy] Re: Error when trying to use a dict

2009-09-27 Thread Michael Bayer
BEES INC wrote: phwoar, ok. I think I understand. To break it down: I have a class Foo which, among other things, contains a dict called vals with keys of dates and values of floats. When I store an instance of Foo, it goes to the foo table, and any items in the vals dict should go into

[sqlalchemy] Re: Error when trying to use a dict

2009-09-26 Thread BEES INC
Ugh, the datatype for vals.val should be float, or the argument passed should be 1 instead of 1.0, it's immaterial to the error im seeing. On Sun, Sep 27, 2009 at 3:25 AM, BEES INC bees@gmail.com wrote: Hi I am having a problem when i run the code below, it gives me the following error:

[sqlalchemy] Re: Error when trying to use a dict

2009-09-26 Thread Michael Bayer
On Sep 26, 2009, at 1:25 PM, BEES INC wrote: class Vals(dict): pass class Foo(object): def __init__(self, name): self.vals = Vals() self.name = name def add(self, key, value): self.vals[key] = value you would need to say