question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQLAlchemy.__init__ stopped working for create_model in 1.5.4

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mrjoescommented, May 4, 2020

Yep, thanks for the MR - accepted.

0reactions
killthekittencommented, May 4, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found