Ok yes it is a very silly question, but just that I am getting a little confused.
I have a file structure which looks like this:-
-Mainapplication
-models.py
-Helpingmodules
-Folder1
-module1.py
Now I have to import models into module1. So in module1.py I just did:-
from Mainapplication import models
Now this does work fine, but I get a feeling that it might be wrong. Can someone please let me know if this is the correct way.
There’s nothing wrong with the import, but if the names of your packages are accurate, this looks like a design flaw in that you’re destroying code reusability; I’d expect a package of “helping modules” to be independent of the application they’re helping (although in the case the package name is so vague that I could be way off about their purpose.)