Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming convention not used when running develop db init #182

Closed
bchopson opened this issue May 9, 2022 · 2 comments
Closed

Naming convention not used when running develop db init #182

bchopson opened this issue May 9, 2022 · 2 comments

Comments

@bchopson
Copy link
Member

bchopson commented May 9, 2022

GH-123 adds a db_before_import signal for defining a naming convention. However, develop db init doesn't use the naming convention defined in the signal handler.

@guruofgentoo
Copy link
Member

A common practice is to attach signal handlers in a separate module, and then list that module in the app's visit_modules. However, the database layer gets set up very early in app init, since it can be useful in just about every other aspect of the application. As a result, db_before_import happens long before visit_modules is processed.

Instead, use db_before_import somewhere that gets loaded at import time for the app (e.g. in the module containing the app itself, or something it imports).

Need to put these notes in the docs for that signal. Also should see if there's a way to know if the signal has been called already.

@guruofgentoo
Copy link
Member

Added the above notes in the signals docs. There's not really a good way to know if the signal has already been called for an app, and connecting a handler isn't directly related to the app either (the handler just gets called with the sending app when the signal is triggered). I'll leave it at docs for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants