Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| from . import app | |
| from flask.sqlalchemy import get_debug_queries | |
| if app.debug: | |
| app.after_request(sql_debug) | |
| def sql_debug(response): | |
| queries = list(get_debug_queries()) | |
| query_str = '' |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!