Пример #1
0
 def from_dict(cls, data: Dict):
     data.update({
         "registered": data["registered"]["timestamp"],
         "image": list(map(Image.from_dict, data["image"])),
     })
     if "recent_track" in data:
         data["recent_track"] = Track.from_dict(data["recent_track"])
     return super().from_dict(data)
Пример #2
0
 def from_dict(cls, data: Dict):
     data.update(
         dict(
             registered=data["registered"]["timestamp"],
             image=list(map(Image.from_dict, data["image"])),
         ))
     if "recent_track" in data:
         data["recent_track"] = Track.from_dict(data["recent_track"])
     return super(User, cls).from_dict(data)