Open 4b11b4 opened 5 years ago
this code is on the song-manager branch
Woah, that example rom the docs surprises me. I don't like to have raw SQL, full-stop, in any of my Django projects. Sometimes it's unavoidable, but fortunately I think for our use case here we don't need any SQL.
I also may have suggested this prematurely, we may not need a custom manager/queryset at all. Let's look at this together next time we meet and see if it helps us.
For now the song-manager branch will sit.
I am attempting to create the first manager method which will: return the set of all songs, filtered by: artist, album, (then?) playlist
note: when we defined our song model, we decided that a song could have multiple artists, and multiple album
Here are four places I could use your help:
I am not sure of the function return data type: a list?
The code I have written closely follows the PollManager example from: https://docs.djangoproject.com/en/2.1/topics/db/managers/#custom-managers
SQL query:
SongManager instantiation inside Model definition: in "song-manager" branch, potify/music/models.py line 49