Skip to content

Commit

Permalink
Add instructions for missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
fyliu committed Sep 29, 2024
1 parent f719711 commit deaaad7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ class AlbumViewSet(viewsets.ViewSet):
1. Here we create a class `AlbumViewSet` inheriting from `views.ViewSet`, pay attention, this is nos a model view set.
2. Set the `queryset`
3. Set `serializer_class`, we are going to talk about this `AlbumSerializer` later
4. For now, just import the `AlbumSerializer` with `from music.serializers import AlbumSerializer`
5. Don't forget to import the Album model here with `from music.models import Album`

After this still in the same view we are going through what DRF call actions.
Instead of have methods in the view set for get, post, delete... It has functions based on actions. The actions are the ones below:
Expand Down

0 comments on commit deaaad7

Please sign in to comment.