def default(self, obj, **kwargs): from wapi.serializers import chain return dict([(k, chain(v)) for k, v in obj.iteritems()])
def default(self, obj, **kw): from wapi.serializers import chain try: return dict([(k, chain(v)) for k, v in obj.__dict__.iteritems() if not k.startswith('_')]) except AttributeError: return dict()