mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-23 17:31:11 +01:00
added base class for api handling
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import json
|
||||
import re
|
||||
|
||||
from bson import json_util
|
||||
|
||||
|
||||
def is_object_id(id):
|
||||
return re.search('^[a-zA-Z0-9]{24}$', id) is not None
|
||||
|
||||
|
||||
def jsonify(obj: dict):
|
||||
dump_str = json_util.dumps(obj)
|
||||
converted_obj = json.loads(dump_str)
|
||||
return converted_obj
|
||||
|
||||
Reference in New Issue
Block a user