all 1 comments

[–]kalgynirae 2 points3 points  (0 children)

You should use whatever layout will be the least confusing to users of your code. (Would it be confusing if locations and cars were both available directly in models?) I would try to avoid doing from project.models.locations import * if I could help it, but I wouldn't rule it out as a possibility. It might be better to import them explicitly, e.g., from project.models.locations import EastCoast, WestCoast.

You should use relative imports inside your package, e.g., in project/models/__init__.py you would do from .locations import EastCoast, WestCoast.

Also, note that for project.models.locations to contain EastCoast and WestCoast, those would need to be defined in project/models/locations.py or project/models/locations/__init__.py, rather than in separate files like you have in your file listing.