import json
This commit is contained in:
@@ -10,6 +10,7 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
from sqlalchemy import and_, or_, not_
|
from sqlalchemy import and_, or_, not_
|
||||||
from sqlalchemy.sql import func
|
from sqlalchemy.sql import func
|
||||||
|
import json
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -47,8 +48,10 @@ class Products(db.Model):
|
|||||||
# ).all()
|
# ).all()
|
||||||
#
|
#
|
||||||
product_list = cls.query.all()
|
product_list = cls.query.all()
|
||||||
|
json_output = json.dumps(product_list.to_dict())
|
||||||
|
print(json_output)
|
||||||
|
|
||||||
return product_list
|
return json_output
|
||||||
|
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user