refactor:
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
|
|
||||||
|
from nc_http.tools.helpers import list_to_tree
|
||||||
|
|
||||||
|
|
||||||
class HandleType:
|
class HandleType:
|
||||||
SWITCH = 1 # 值交换
|
SWITCH = 1 # 值交换
|
||||||
@@ -169,11 +171,12 @@ class FESucks:
|
|||||||
|
|
||||||
return rs
|
return rs
|
||||||
|
|
||||||
@classmethod
|
@staticmethod
|
||||||
def _parse_keys(cls, key, keys):
|
def _parse_keys(key, keys):
|
||||||
keys = keys or []
|
keys = keys or []
|
||||||
if key:
|
if key:
|
||||||
keys.append(key)
|
keys.append(key)
|
||||||
|
|
||||||
return keys
|
return keys
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -186,12 +189,7 @@ class FESucks:
|
|||||||
:param i:
|
:param i:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
data = []
|
return list_to_tree(rows, id_key, parent_id_key, i)
|
||||||
for row in rows:
|
|
||||||
if row[parent_id_key] == i:
|
|
||||||
row['children'] = FESucks.list_to_tree(rows, id_key, parent_id_key, row[id_key])
|
|
||||||
data.append(row)
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
@@ -1,2 +1,8 @@
|
|||||||
pycman
|
pycman
|
||||||
coverage
|
coverage
|
||||||
|
flask
|
||||||
|
werkzeug
|
||||||
|
xlsxwriter
|
||||||
|
xlrd
|
||||||
|
captcha
|
||||||
|
six
|
||||||
|
Reference in New Issue
Block a user