In python I put my base models in models/__init__.py. The bases have things for managing data behind the scenes, adding common utility methods, etc. If I’m using another library or method to serialize data I’d put it in a separate utility script somewhere, it’s probably going to be useful to more than just data models and it’s easy enough to import.
Then each file that defines models has a from models importBaseModel or whatever else is needed, keeping each file relatively short and focused to what it needs to do.
In python I put my base models in
models/__init__.py
. The bases have things for managing data behind the scenes, adding common utility methods, etc. If I’m using another library or method to serialize data I’d put it in a separate utility script somewhere, it’s probably going to be useful to more than just data models and it’s easy enough to import.Then each file that defines models has a
from models import BaseModel
or whatever else is needed, keeping each file relatively short and focused to what it needs to do.