fix: json.loads加引号包裹,json.dumps输出是Python字面量不是字符串
This commit is contained in:
parent
af6006ffe3
commit
5107e6c830
@ -149,7 +149,7 @@ if not ns.get('sort'):
|
|||||||
{% if type(sortby) == type("") %}
|
{% if type(sortby) == type("") %}
|
||||||
ns['sort'] = '{{sortby}}'
|
ns['sort'] = '{{sortby}}'
|
||||||
{% else %}
|
{% else %}
|
||||||
ns['sort'] = json.loads({{json.dumps(sortby)}})
|
ns['sort'] = json.loads('{{json.dumps(sortby)}}')
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
ns['sort'] = 'id'
|
ns['sort'] = 'id'
|
||||||
@ -160,7 +160,7 @@ ns['sort'] = '{{relation.outter_field}}_text'
|
|||||||
sql = '''{{sql}}'''
|
sql = '''{{sql}}'''
|
||||||
{% if not relation %}
|
{% if not relation %}
|
||||||
{% if data_filter %}
|
{% if data_filter %}
|
||||||
filterjson = json.loads({{json.dumps(data_filter, ensure_ascii=False)}})
|
filterjson = json.loads('{{json.dumps(data_filter, ensure_ascii=False)}}')
|
||||||
{% else %}
|
{% else %}
|
||||||
filterjson = None
|
filterjson = None
|
||||||
fields_str=r'''{{json.dumps(fields, indent=4, ensure_ascii=False)}}'''
|
fields_str=r'''{{json.dumps(fields, indent=4, ensure_ascii=False)}}'''
|
||||||
@ -450,7 +450,7 @@ async with db.sqlorContext(dbname) as sor:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
tblfields = json.loads({{json.dumps(fields, ensure_ascii=False)}})
|
tblfields = json.loads('{{json.dumps(fields, ensure_ascii=False)}}')
|
||||||
tblfname = [ f['name'] for f in tblfields ]
|
tblfname = [ f['name'] for f in tblfields ]
|
||||||
other_keys = [ k for k in ns.keys() if k in tblfname and k != 'id' ]
|
other_keys = [ k for k in ns.keys() if k in tblfname and k != 'id' ]
|
||||||
if len(other_keys) > 0:
|
if len(other_keys) > 0:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user