SQLAlchemy.__init__ stopped working for create_model in 1.5.4
See original GitHub issueThe custom __init__
does not get called when the model is created through the create_view
. Noticed after upgrading 1.5.3->1.5.4.
#1811 seems to introduce the bug, and the follow-on patch doesn’t help.
Tested with SQLAlchemy 1.3.8 and 1.3.11 by throwing a breakpoint in the __init__
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
python - SQLAlchemy __init__ not running - Stack Overflow
It seems to me that my __init__ method is not run as I can't see any print statements in my log.
Read more >Constructors and Object Initialization — SQLAlchemy 1.3 ...
It is invoked after all immediate column-level attributes are loaded as well as after eagerly-loaded scalar relationships. Eagerly loaded collections may be ...
Read more >Declaring Models — Flask-SQLAlchemy Documentation (2.x)
Since a person with no name or an email address with no address associated makes no sense, nullable=False tells SQLAlchemy to create the...
Read more >Python Flask Tutorial #4: Using SQLAlchemy to create models
In this #4 video of my Flask Tutorial for absolute beginners we'll use SQLAlchemy ORM to create and store Posts.In this video:- how...
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 Free
Top 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
Yep, thanks for the MR - accepted.
@mrjoes I’m following up on the discussion with #1981. It introduces a custom hook that you can override directly, without copying the entire
create_model
into the base class.