MikeElahi/sample-django

Extra information on Projects

Closed this issue · 0 comments

Extra information is needed for Project: Add a get_total_time_spent method to Project model.

  • It was considered to use a mixin to add this functionality with reusability in mind, however, the cost to benefit ratio of attempting to write this extension dynamically was unclear.
  • The decision to put the business logic inside the model itself instead of the serializer was made to allow for maximum usability of the method

Approach

  • Add a get_total_time_spent function to Project
  • Add tests for get_total_time_spent that asserts the correct total count calculation