sdss / sdss/sdssdb

Reloading the database doesn't trigger reflection

Open
#320 1 comment 0 reactions 1 assignee View on GitHub

@albireox is already working on this.

Since Jun 4, 2026.

Dominant language
Python
Stars
8
Forks
2
PR merge metrics
No merged PRs in 30d

Description

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().

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.