Django Model Style Guide
Photo by Héctor J. Rivas on Unsplash
(This post is mostly for my own reference)
James Bennett mentions a Django style guide in his book Practical Django Projects.
I couldn't find reference to it, but the following is the order of things when it comes to models:
- Any constants and/or lists of choices
- The full list of fields
- The Meta class if present
- The Admin class if present
- The unicode() method
- The save() method, if its being overridden
- The get_absolute_url() method, if present
- Any additional custom methods