I can’t work out what the appropriate model structure should be for this problem (simplified version to make explanation easier)
The goal is:
- a Person model with required fields
- When adding a person, you can optionally put in initial values for weight and height (one entry for each, default to 0)
- When values for height and/or weight are updated, the previous value is stored some where so the history can be viewed
I know I can have a separate model for height and for weight, linking them to Person by ForeignKey but it makes the admin presentation confusing and dis-jointed by allowing multiple entries at a time.
Alternatively, can I have height and weight as fields in Person (benefit of having clean list_view and inclusion of these fields in fieldsets), and when there is any update store the previous value into a different model? This model can then be listed to show some one’s history of values.
Any help is greatly appreciated.
Use ForeignKeys to height and weight models, then add a property to access that field