Trying to work my way through a Django tutorial, and can't seem to get past this syntax error when I implement a new method:
class Album(models.Model):
artist = models.CharField(max_length = 250)
album_title = models.CharField(max_length = 500)
genre = models.CharField(max_length = 100)
album_logo = models.CharField(max_length = 1000)
def__str__(self):
return self.album_title + ' - ' + self.artist
class Song(models.Model):
album = models.ForeignKey(Album, on_delete=models.CASCADE)
file_type = models.CharField(max_length = 10)
song_title = models.CharField(max_length = 250)
Whenever I run it, I get a syntax error at def_str_(self):
I've checked all of the indents to make sure the spaces are consistent, and I've tried the same method using only spaces and only tabs and neither work. Any thoughts?