Convert model to json

This commit is contained in:
2022-03-13 21:41:52 +01:00
parent f400192e7f
commit c5b6e85c4d
2 changed files with 13 additions and 2 deletions

View File

@@ -1,6 +1,5 @@
from flask import Flask, jsonify
from dotenv import load_dotenv
from db import db
from models import *
@@ -27,7 +26,7 @@ def create_app():
def users():
res = []
for i in User.query.all():
res.append(i.to_dict(show='*'))
res.append(i.as_dict())
return jsonify(res)