wger icon indicating copy to clipboard operation
wger copied to clipboard

Allow multiple weight entries per day

Open scrapcode opened this issue 9 months ago • 2 comments

Proposed Changes

  • Refer to Issue #1814
  • Changed the WeightEntry date attribute from a DateField to a DateTimeField
  • Removed the unique_together of user and date.
  • Removed the restriction of only being allowed to add a new weight entry every so often. You can now add multiple weight entries per day.
    • Removed or altered tests that tested this functionality
  • Changed the method of getting and constructing dates from naive to aware, and to include times.
  • Added DATETIME_FORMATS constants.
  • Modified seeded testing data to reflect aware datetime formats.

TODO: Frontend Implementation

  • This will still need implementation on the frontend. Adding multiple weight entries per day works but are currently all added with the time as 23:00:00. How this is displayed on the graph may want to be taken into consideration as well.
    • flutter#641
    • react#990

Please check that the PR fulfills these requirements

  • [x] Tests for the changes have been added (for bug fixes / features)
    • Multiple tests and testing methods had to be modified or removed to allow for the new functionality.
  • [x] Added yourself to AUTHORS.rst

Other questions

  • Do users need to run some commands in their local instances due to this PR (e.g. database migration)?
  • python manage.py migrate

scrapcode avatar Feb 23 '25 01:02 scrapcode

you're on fire!

Also, there were more changes needed that I had thought. Will you take a shot at the frontend as well or should I do it?

rolandgeider avatar Feb 23 '25 10:02 rolandgeider

Will you take a shot at the frontend as well or should I do it?

I'll give it a whirl!

scrapcode avatar Feb 24 '25 01:02 scrapcode

we can finally merge this 🥳 (and sorry for the wait)

PS: the last test is failing because it can't upload the coverage report, so all is fine

rolandgeider avatar Sep 26 '25 12:09 rolandgeider