> > The association proxy will take care of Attribute construction for > you, so you can get away with just: > > class AttributeDictNEW(dict): > def append(self, item): > self[item.key] = item > def __iter__(self): > return self.itervalues() >
So now I if I try to get something from the dict: obj.attr['foo'] I get this error: KeyError: <schema.Attribute object at 0xb78a8e0c> ok, so it looks like something is turning 'foo' into an Attribute. Fine, so I add this to the AttributeDictNEW: def __getitem__(self, item): return super(AttributeDictNEW, self).__getitem__(item.name) But I get: return super(AttributeDictNEW, self).__getitem__(item.name) AttributeError: 'str' object has no attribute 'name' if I do a sys.stderr.write(str(type(item))) before the return it outputs this: <class 'schema.Attribute'> item is an Attribute, but the error indicates it's a str that doesn't have a 'name' member variable. So I'm totally confused. -Ron --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---