def __dict__(self): return { "name": self.name, "year": self.year, "recorder": DBRef(collection=DataBase.get_type_collection(self.recorder), id=self.recorder.id), "types": self.types, "songs": [ DBRef(collection=DataBase.get_type_collection(song), id=song.id) for song in self.songs ] }
def __dict__(self): return { "name_song": self.name_song, "author": DBRef(collection=DataBase.get_type_collection(self.author), id=self.author.id) }