Created
April 27, 2020 20:21
-
-
Save Porter97/3f91f405428889df8a3015515b7f93b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#... | |
class Collection(db.Model): | |
#... | |
def to_json(self): | |
json_collection = { | |
'id': self.id, | |
'name': self.name, | |
'description': self.description, | |
'author': self.author.to_json(), | |
'createdAt': self.timestamp, | |
} | |
return json_collection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment