usero = toobj({'name': 'sam', 'id': 123})
print(json.dumps(usero))
obj = 'Company'
Class_name = globals()[obj]
companyo = await Class_name.filter(id=2).first()
creatoro = await companyo.creator.get()
creator = await companyo.creator.values()
print(type(companyo))
print(type(creatoro))
print(companyo.id)
print(companyo.creator_id) # todo companyo.creator_id == creator.id
print(creator.id)
print(creatoro.name)
print(creator.get('id'))
标签:companyo,经验,tortoise,creator,await,ORM,print,id,name From: https://www.cnblogs.com/pearlcity/p/17829736.html