pallets-eco / pallets-eco/flask-debugtoolbar

Add config flag for SQLAlchemy vs. Flask-SQLAlchemy Extension

Open
#161 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
978
Forks
151
PR merge metrics
No merged PRs in 30d

Description

Achieved it this way, but it would be nice if there was an option within flask-debugtoolbar to toggle the use between the two:

# https://pypi.org/project/flask-debugtoolbar-sqlalchemy/
# https://git.sr.ht/~ihabunek/flask_debugtoolbar_sqlalchemy/tree/master

# Remove the Flask-SQLAlchemy Extension specific SQLAlchemyDebugPanel and Replace with SQLAlchemyPanel

app.config['DEBUG_TB_PANELS'] = tuple(
      list(
            map(
                  lambda x: x.replace(
                        'flask_debugtoolbar.panels.sqlalchemy.SQLAlchemyDebugPanel',                                                                         
                        'flask_debugtoolbar_sqlalchemy.SQLAlchemyPanel'
                  ), 
                  list(
                        app.config['DEBUG_TB_PANELS']
                  )
            )
      )
)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading how DEBUG_TB_PANELS currently selects flask_debugtoolbar.panels.sqlalchemy.SQLAlchemyDebugPanel and compare it with flask_debugtoolbar_sqlalchemy.SQLAlchemyPanel. Done means users can configure a flag to choose either integration without manually rewriting the panel list, with the existing behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
flask, python, sqlalchemy
Domain
backend, databases, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.