예제 #1
0
파일: rawjson.py 프로젝트: kagesenshi/haifu
def json_encoder(obj):
    iface = getattr(obj, '__schema__', None)
    if iface is None:
        return obj
    return to_dict(obj)
예제 #2
0
파일: ocsjson.py 프로젝트: kagesenshi/haifu
 def __call__(self):
     result = to_dict(self.context)
     return result
예제 #3
0
파일: ocsjson.py 프로젝트: kagesenshi/haifu
 def __call__(self):
     result = to_dict(self.context)
     for listing in result.get('listings', []):
         result[listing.type_] = listing.items
     return result
예제 #4
0
파일: ocsxml.py 프로젝트: kagesenshi/haifu
 def __call__(self):
     return to_dict(self.context)