Now I'm having trouble with updating values in AttributeDict:

so

obj.attrs['key'] = 'somevalue'   (works)
obj.attrs['key'] = 'newvalue'    (second one doesn't work)

I get this error:

  File "/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.3.8-
py2.4.egg/sqlalchemy/orm/mapper.py", line 679, in init
    raise e
TypeError: <lambda>() takes exactly 2 arguments (3 given)

Any more ideas?

-Ron


On Jun 12, 2:52 pm, jason kirtland <[EMAIL PROTECTED]> wrote:
> Ron wrote:
>
> > Nevermind.  I see what I was doing.  In much of my code it worked
> > fine, just like a dictionary.
>
> > But in another part of my code I do:
>
> > for i in self.attrs:
> >    ...blah
>
> > which works like a list.  I remember when I saw the __iter__
> > implementation requirement noting that that may be confusing.
>
> That's a side-effect of the way dict collections are managed by the
> InstrumentedList.  The iterator behavior will be over keys as you'd
> expect in 0.4, both on dict collection classes and in dict-based
> association proxies.
>
> I think the 0.3 association proxy does that only to be consistent
> with the underlying attribute's iterator, but I don't see any
> strong reason to keep that behavior in 0.3, especially as
> association dict support is pretty much brand new.  Making the
> assoc proxy's iterator truly dict-like can go in 0.3.9 if there's
> call.
>
> Cheers,
> Jason


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to