> The new Entity.set in Elixir 0.6 breaks some of my projects.
Sorry to hear that (and sorry it took me so long to reply).
> In 0.5.2, the __init__ and .set methods performed the same
> function:
> for key, value in kwargs.items():
> setattr(self, key, value)
>
> My first question is, why didn't __init__() just call set()? Were
> you looking forward to the changes in 0.6? Even in 0.6, should
> __init__ just call set()? Perhaps the answer lies in my second
> question.
I believe that Gaetan made this change, and he won't be back from
his honeymoon until tomorrow. I suspect he'll probably need a little
time to get settled again.
> Is there perhaps a better way to implement the to/from_dict
> methods to (a) better handle properties whose names differ from
> the column names and (b) allow set to be backward compatible with
> 0.5?
>
> I wanted to start with the discussion here. Let me know if I
> should post any of these in the trac ticket system.
I think you are right after reviewing your reasoning. Go ahead and
open a ticket, and reply to this list when you've done so. Once
Gaetan gets back into the swing of things, we can have a discussion
about the reasoning for the original change, and see if we can come
up with a better solution before we release a new version.
Thanks for the heads up, and sorry for the late reply!
--
Jonathan LaCour
http://cleverdevil.org
I can't find any good reason for that. It was just an oversight I suppose.
>> you looking forward to the changes in 0.6? Even in 0.6, should
>> __init__ just call set()?
Yes I think it should, but we should first make sure from_dict is a
superset of the "set" method functionality (which I thought it was).
>> Perhaps the answer lies in my second
>> question.
Indeed.
>> Is there perhaps a better way to implement the to/from_dict
>> methods to (a) better handle properties whose names differ from
>> the column names and (b) allow set to be backward compatible with
>> 0.5?
Yes, that should be the case IMO.
>> I wanted to start with the discussion here. Let me know if I
>> should post any of these in the trac ticket system.
Please do.
> I think you are right after reviewing your reasoning. Go ahead and
> open a ticket, and reply to this list when you've done so. Once
> Gaetan gets back into the swing of things, we can have a discussion
> about the reasoning for the original change, and see if we can come
> up with a better solution before we release a new version.
The reasoning was just to augment the set method with more
functionality. I just didn't realize it was not backward compatible
when I applied the patch from Paul Johnston. Should be fixable though.
Anybody want to try his luck at fixing this?
--
Gaëtan de Menten
http://openhex.org