def serialized(self): comment = { "id": self.id, "sender": dump_sender(self.sender) } if self.content: comment["content"] = self.content return comment
def serialized(self): tweet = {"id": self.id, "sender": dump_sender(self.sender)} if self.content: tweet["content"] = self.content if self.comments: tweet["comments"] = dump_comments(self.comments) if self.images: tweet["images"] = dump_images(self.images) return tweet
def serialized(self): tweet = { "id": self.id, "sender": dump_sender(self.sender) } if self.content: tweet["content"] = self.content if self.comments: tweet["comments"] = dump_comments(self.comments) if self.images: tweet["images"] = dump_images(self.images) return tweet
def serialized(self): comment = {"id": self.id, "sender": dump_sender(self.sender)} if self.content: comment["content"] = self.content return comment