Alberto Valverde wrote:
> I'm attaching a patch that implements the ObjToDct (non recursive)
> we've been discussing. It doesn't break current tests but I haven't
> tested with a real SQLObject (or any other) so I cannot guarantee
> anything :/
>
> However, it should serve as a starting point....
>

Disclaimer: I haven't looked at your patch yet.

Anyway I was wondering, if we do something like this? shouldn't it
work? simple and straigtforward no ObjToDict needed, we simply prepare
a dict on the fly without leaving this job to the user...

def adjust_value(value=None, **params):
     if value is not None and not isinstance(value, dict):
         adapted_value = {}
         for w in self.iter_member_widgets():
              if hasattr(value, w.name):
                  adapted_value[w.name] = getattr(value, w.name)
         value = adapted_value
    return super(CompoundWidget, self).adjust_value(value, **params)

Ciao
Michele


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~----------~----~----~----~------~----~------~--~---

Reply via email to