Style guides
General
Documentation!
All modules and features should have documentation under a matching folder in these docs 'features' folder.
The development of the module as well as anything that will change functionality should be documented. Bug fixes shouldn't need to be written up.
Rather than one large file, each change should be an individual file. The creation of the module would be one file, along with any feedback during development. Then when later going back to add new functionality, new files should be written and added to the folder for the module in the 'features' folder.
Python / Backend
Fat Models / Skinny Views
Functionality and operations performed on models should live on that model or it's model manager. Functionality put into methods should be directly relevant to that model though.
If that doesn't make sense to put it on a model, or it involves acting on multiple models or no models at all, they should be utility functions. The best place to put the is a utils.py file next to the relevant models.py.
Views shouldn't have must logic outside of processing the request. FOr example filtering a query set based on request.GET params. Any heavy logic should likely be abstracted to a utility function of a method on the model or model manager.
Testing
New modules require basic tests (CRUD, etc).
- Listing
- Creation
- Details
- Updating
- Deletion
- Permissions
Fixtures should be functions that create the objects.
The majority of tests should be integration tests, using the Django client test library to go through the request/response cycle.
Unit tests should be reserved for methods on ORM classes or utility classes. We shouldn't be unit testing views.
Vue / Frontend
Data access layers
Actual data transfers should occur into their components that wrap any form components.