Skip to content
Snippets Groups Projects
Commit 7f77caf6 authored by Brian Wood's avatar Brian Wood
Browse files

Updated User and Movie

parent 44e1b64f
No related branches found
No related tags found
No related merge requests found
......@@ -21,4 +21,8 @@ class Movie(db.Document):
return self.title
def __repr__(self):
return {'created': self.created, 'title': self.title, 'summary': self.summary, 'tags': str(self.tags), 'id':str(self.id)}
return str(self.toJSON())
def toJSON(self):
import json
return json.dumps({'created': self.created.isoformat(), 'title': self.title, 'summary': self.summary, 'tags': str(self.tags), 'id':str(self.id)})
\ No newline at end of file
......@@ -49,7 +49,11 @@ class User(db.Document):
return self.email
def __repr__(self):
return {'created': self.created, 'email': self.email, 'roles': self.roles, 'id':str(self.id)}
return str(self.toJSON())
def toJSON(self):
import json
return json.dumps({'created': self.created.isoformat(), 'email': self.email, 'roles': self.roles, 'id':str(self.id)})
meta = {
'allow_inheritance': True,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment