[x] Create the comments app and register in the settings.py file
[x] Create Comment model and add fields (reference database schema).
[x] Make migrations and migrate changes to the database.
[x] Register Comment model in the admin.py file in order to access from the Django admin panel.
[x] Create CommentSerializer Class in the serializers.py file. Additional fields to include in the JSON response:
[x] The owner's username
[x] is_owner boolean value
[x] The comment owner's profile id and profile image
[x] Create CommentDetailSerializer Class which includes 'snapshot' field which references the snapshot id that the comment is associated with.
[x] Write List view using the generics ListCreateAPIView, with following functionality:
[x] Use the permissions class IsAuthenticatedOrReadOnly, to ensure only logged in users can create a new comment.
[x] Define the perform_create method, so every time a new comment is created it is associated with the logged in user.
[x] Write Detail view using the generics RetrieveUpdateDestroyAPIView with following functionality:
[x] Use the permissions class IsOwnerOrReadOnly defined in rewind/permissions.py, to ensure a user can only edit or delete a comment if they own it. All users should be able to retrieve a specific comment by id.
[x] Add urls for list and detail views
[x] Include comments urls in master rewind url patterns.
EPIC: #30
RELATED USER STORIES:
18
19
20
Tasks
rewind/permissions.py
, to ensure a user can only edit or delete a comment if they own it. All users should be able to retrieve a specific comment by id.