Skip to content

Instantly share code, notes, and snippets.

@Porter97
Created April 27, 2020 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Porter97/3f91f405428889df8a3015515b7f93b8 to your computer and use it in GitHub Desktop.
Save Porter97/3f91f405428889df8a3015515b7f93b8 to your computer and use it in GitHub Desktop.
#...
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