Add sensible string representation.
authorDavid ‘Bombe’ Roden <bombe@demoscenemusic.org>
Thu, 9 May 2013 20:29:15 +0000 (22:29 +0200)
committerDavid ‘Bombe’ Roden <bombe@demoscenemusic.org>
Thu, 9 May 2013 20:29:15 +0000 (22:29 +0200)
data/models.py

index 60e60b3..283f806 100644 (file)
@@ -45,11 +45,17 @@ class TrackArtist(models.Model):
        artist = models.ForeignKey(Artist)
        order = models.IntegerField()
 
+       def __unicode__(self):
+               return self.artist.name
+
 class RemixArtist(models.Model):
        track = models.ForeignKey('Track')
        artist = models.ForeignKey(Artist)
        order = models.IntegerField()
 
+       def __unicode__(self):
+               return self.artist.name
+
 class Track(models.Model):
        name = models.CharField(max_length = 150)
        artists = models.ManyToManyField(Artist, through = TrackArtist)