summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frest/auth/models.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/frest/auth/models.py b/frest/auth/models.py
index da7f22c..6c0d6f3 100644
--- a/frest/auth/models.py
+++ b/frest/auth/models.py
@@ -33,6 +33,16 @@ class User(db.Model):
def __repr__(self):
return f"<User '{self.userId}'>"
+ def as_json(self):
+ _d = {
+ "userId": self.userId,
+ "email": self.email,
+ "is_admin": self.is_admin,
+ "name": self.name,
+ "created_at": self.created_at,
+ }
+ return _d
+
class Token(db.Model):
tokenId = db.Column(db.Integer, primary_key=True)