organizations&organizationtypes
This commit is contained in:
@@ -6,8 +6,6 @@ from .model import ArticleSchema
|
||||
from datetime import datetime
|
||||
import json
|
||||
|
||||
#flask.json.JSONEncoder.default = lambda self,obj: (obj.isoformat() if isinstance(obj, datetime) else None)
|
||||
#flask.json.JSONEncoder.default = lambda self,obj: ((obj.dict()) if isinstance(obj, Article) else None)
|
||||
from src import clogger
|
||||
import json
|
||||
from src.database import db_session, read_json
|
||||
@@ -15,7 +13,7 @@ import flask
|
||||
|
||||
#flask.json.JSONEncoder.default = lambda self,obj: ((ArticleSchema().dump(obj)[0]) if isinstance(obj, Article) else None)
|
||||
flask.json.JSONEncoder.default = lambda self,obj: ((obj.__json__()) if isinstance(obj, (Base, Article,CrawlUrl)) else None)
|
||||
import controller
|
||||
from controller import controller
|
||||
@article_pages.route("/")
|
||||
@article_pages.route("")
|
||||
@article_pages.route(".json")
|
||||
@@ -57,7 +55,7 @@ def get(id):
|
||||
@article_pages.route("/<int:id>.json",methods=['DELETE'])
|
||||
def delete(id):
|
||||
article=Article.query.get(id)
|
||||
clogger.info(id)
|
||||
# clogger.info(id)
|
||||
if article != None:
|
||||
db_session.delete(article)
|
||||
db_session.commit()
|
||||
|
||||
Reference in New Issue
Block a user