title: Django model primary key as a pair
body: <p>I am trying to make an app where users will login to their profile and can add songs to their favorite list. I am defining a M2M relationship for this.</p>
  
  <p>My question is how to say combination of (song, singer) is unique? 
  I searched and found that it may be possible through unique_together. Is this the correct way of setting this?</p>
  
  <p>models.py:</p>
  
  <pre><code>from django.contrib.auth.models import User
  
  
  class Singer(models.Model):
      name = models.CharField(max_length=500, unique=True)
  
      def __str__(self):
         return self.name
  
  
  class Song(models.Model):
     id = models.AutoField(primary_key=False)
     singer = models.ForeignKey(Singer, on_delete=models.CASCADE, related_name='song')
     name = models.CharField(max_length=500)
  
     Class Meta:
         unique_together = (singer, id)
  
     def __str__(self):
         return self.name
  
  class Profile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE)
      songs = models.ManyToManyField(Song,  related_name='profile')
  
      def __str__(self):
          return self.user.username
  </code></pre>
  
  <p>Please feel free to correct my models.py, if you think the relationship is not correct.</p>
  
  <p>Thanks,</p>