he/him

Nerd, programmer, writer. I like making things!

  • 100 Posts
  • 1.63K Comments
Joined 2 years ago
cake
Cake day: June 20th, 2023

help-circle








  • 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.