[sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-13 Thread Eric Ongerth
Thank you, Mike. Hmm... I tried exactly that technique, the last time I found myself with a similar need, a year or two ago. I seem to remember it only caused the problem to regress one step farther. But I must have missed something and will probably give it another shot. Any suggestions on

Re: [sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-13 Thread Michael Bayer
its probably easier to use __missing__ - see attached. On Mar 13, 2011, at 4:26 AM, Eric Ongerth wrote: Thank you, Mike. Hmm... I tried exactly that technique, the last time I found myself with a similar need, a year or two ago. I seem to remember it only caused the problem to regress

[sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-13 Thread Eric Ongerth
Cool! I was unaware of __missing__. Thanks again. On Mar 13, 10:24 am, Michael Bayer mike...@zzzcomputing.com wrote: its probably easier to use __missing__ - see attached.  dict_of_sets_with_default.py 1KViewDownload On Mar 13, 2011, at 4:26 AM, Eric Ongerth wrote: Thank you, Mike.  

[sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-13 Thread Eric Ongerth
Ah, brilliant! So now I'm analyzing what prevented me from coming up with that solution before it looks like my problem, or mental block, was that I was trying to find a magic incantation to allow me to get the whole dict-of-set behavior defined from the A class, rather than allowing it to be

Re: [sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-12 Thread Michael Bayer
On Mar 10, 2011, at 6:20 PM, Eric Ongerth wrote: So, jek, if you're listening, or anyone else -- is there an already existing, working implementation of a Dict of Lists or Dict of Sets collection class? the association_proxy is always there to flatten the object in the middle of two

[sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-10 Thread Eric Ongerth
Ach, I did it again... proceeded as if column_mapped_collection and attribute_mapped_collection provide collection classes that are dicts of lists. No, they're just dicts of scalar values! Again and again I need dicts of lists. They seem to really fit the data that I tend to work with; A's

[sqlalchemy] Re: Has anyone already got a collection_class mod that uses defaultdict?

2011-03-10 Thread Eric Ongerth
So, jek, if you're listening, or anyone else -- is there an already existing, working implementation of a Dict of Lists or Dict of Sets collection class? On Mar 10, 1:55 pm, Eric Ongerth ericonge...@gmail.com wrote: Ach, I did it again... proceeded as if column_mapped_collection and