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

makemigrations fails to recognize new models in arches applications #10280

Closed
chiatt opened this issue Nov 18, 2023 · 2 comments
Closed

makemigrations fails to recognize new models in arches applications #10280

chiatt opened this issue Nov 18, 2023 · 2 comments
Assignees

Comments

@chiatt
Copy link
Member

chiatt commented Nov 18, 2023

When a user creates a new Arches App, the app contains a models directory rather than a models.py file. If an app developer creates models within the models directory and then runs makemigrations, django will not find the models and no migration will be created. If a models.py file is added outside of the models directory, and the user runs makemigrations, django will still fail to find the new models. Using a models.py file and removing the models directory fixes this issue.

New apps should probably not add a models directory, but just a models.py file. This would also be consistent with the default structure of a new Django app.

@chiatt chiatt added this to pipeline Nov 18, 2023
@chiatt chiatt moved this to 🆕 Under Review/Discussion in pipeline Nov 18, 2023
@jacobtylerwalls
Copy link
Member

New apps should probably not add a models directory, but just a models.py file. This would also be consistent with the default structure of a new Django app.

👍

Apps that anticipate having a large number of models can use the folder structure if they remember to import the models in __init__.py or add a wildcard import there.

@chiatt
Copy link
Member Author

chiatt commented Nov 20, 2023

Good point. That should probably be added to the docs.

@chrabyrd chrabyrd moved this from 🆕 Under Review/Discussion to 🏗 In Progress in pipeline Nov 22, 2023
@chiatt chiatt closed this as completed Nov 22, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in pipeline Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants