Skip to main content
added 47 characters in body
Source Link
l0b0
  • 9.1k
  • 22
  • 36

Some suggestions:

  1. Chore's period field should probably be period_days to avoid the comment.
  2. The comment on update makes it look like it should be called mark_complete or something, so that you can remove the comment. In any case I would expect the view rather than the model to do that update.
  3. It is customary to use a ModelViewSet to encapsulate the sort of functions you have in views.py.
  4. Chore.DoesNotExist should result in a HTTP 404 response code, which is the default. No need for custom code. In general, letting DRF decide the response code is much easier.
  5. The test classes have inconsistent naming.

Some suggestions:

  1. Chore's period field should probably be period_days to avoid the comment.
  2. The comment on update makes it look like it should be called mark_complete or something, so that you can remove the comment. In any case I would expect the view rather than the model to do that update.
  3. It is customary to use a ModelViewSet to encapsulate the sort of functions you have in views.py.
  4. Chore.DoesNotExist should result in a HTTP 404 response code, which is the default. No need for custom code. In general, letting DRF decide the response code is much easier.

Some suggestions:

  1. Chore's period field should probably be period_days to avoid the comment.
  2. The comment on update makes it look like it should be called mark_complete or something, so that you can remove the comment. In any case I would expect the view rather than the model to do that update.
  3. It is customary to use a ModelViewSet to encapsulate the sort of functions you have in views.py.
  4. Chore.DoesNotExist should result in a HTTP 404 response code, which is the default. No need for custom code. In general, letting DRF decide the response code is much easier.
  5. The test classes have inconsistent naming.
Source Link
l0b0
  • 9.1k
  • 22
  • 36

Some suggestions:

  1. Chore's period field should probably be period_days to avoid the comment.
  2. The comment on update makes it look like it should be called mark_complete or something, so that you can remove the comment. In any case I would expect the view rather than the model to do that update.
  3. It is customary to use a ModelViewSet to encapsulate the sort of functions you have in views.py.
  4. Chore.DoesNotExist should result in a HTTP 404 response code, which is the default. No need for custom code. In general, letting DRF decide the response code is much easier.