Skip to content

Reloading the database doesn't trigger reflection #320

Description

@albireox

For models that rely on reflection to populate fields, the expected behaviour is that when the database connects, the post_connect() hook will reload those models and the reflection will kick in. I'm fairly sure this was working before but doesn't seem to be the case anymore, maybe as a result of Peewee 4.

The consequence is that if one initially imports a model that relies on reflection when its bound database connection is not established, and the one does connect to the database, reflection won't work unless one explicitly does Model.reflect().

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions