MCPcopy Create free account
hub / github.com/dataease/SQLBot / transFilterTree

Function transFilterTree

backend/apps/datasource/crud/row_permission.py:12–24  ·  view source on GitHub ↗
(session: SessionDep, current_user: CurrentUser, tree_list: List[any],
                    ds: CoreDatasource)

Source from the content-addressed store, hash-verified

10
11
12def transFilterTree(session: SessionDep, current_user: CurrentUser, tree_list: List[any],
13 ds: CoreDatasource) -> str | None:
14 if tree_list is None:
15 return None
16 res: List[str] = []
17 for dto in tree_list:
18 tree = dto.tree
19 if tree is None:
20 continue
21 tree_exp = transTreeToWhere(session, current_user, tree, ds)
22 if tree_exp is not None:
23 res.append(tree_exp)
24 return " AND ".join(res)
25
26
27def transTreeToWhere(session: SessionDep, current_user: CurrentUser, tree: any, ds: CoreDatasource) -> str | None:

Callers 1

Calls 2

transTreeToWhereFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected