Skip to content

Add config flag for SQLAlchemy vs. Flask-SQLAlchemy Extension #161

@akcode47

Description

@akcode47

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']
                  )
            )
      )
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions