BUG: FlaskDB incorrect implementation
See original GitHub issue-
current implementation of
FlaskDB
https://github.com/coleifer/peewee/blob/master/playhouse/flask_utils.py#L87 is incorrect: it storesdatabase
inself
instead of the flask context -
that prevents
FlaskDB
to be used with flask factory pattern for tests with multiple flask app instances using different per-app-instance database configurations created inside single python process -
see: https://flask.palletsprojects.com/en/1.1.x/patterns/appfactories/#factories-extensions https://flask.palletsprojects.com/en/1.1.x/extensiondev/#the-extension-code
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
flask db init leads to "KeyError: 'migrate' - Stack Overflow
I tried it for hours know but found no solution so far. What am I doing wrong? Please help me. python · flask...
Read more >Error on flask db upgrade · Issue #341 - GitHub
Hi! I'm trying to implement flask_migrate on my project. I use app factory pattern and followed the instructions from the blog.
Read more >Fixing ALTER TABLE errors with Flask-Migrate and SQLite
SQLite's ALTER TABLE Implementation ... The problem occurs when you try to upgrade the database with this ... Run flask db downgrade ....
Read more >Fixing ALTER TABLE errors with Flask-Migrate and SQLite
In this video you can learn how to workaround the common ALTER TABLE errors that appear when migrating a SQLite database with Flask-Migrate ......
Read more >Flask-DB Helps You Migrate, Seed and Reset Your ... - YouTube
It adds a new flask db command. For migrations it uses Alembic under the hood.Hit the subscribe button to receive more videos like...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
even more simplified example:
well, we do not want to follow low standards, do we? 😃
on another note, this pattern is also a major pain:
current_app
analogue would be less evil