title: Getting unique value on the base of Role
body: <p>I have model name Movie which have many-to-many Relation with Actor Table. Actor Table is further many-to-many relation with Celebrity-Role.
  My question is i need only unique values on the base of roles Like Actors who's role is Director they show in Movie Table field with Director and only directors should be there and so on.
  i share my models please have a look.</p>
  <pre><code>class CelebrityRole(models.Model):
      CELEBRITY_CHOICES = (
          ('Actor', 'Actor'),
          ('Producer', 'Producer'),
          ('Writer', 'Writer'),
          ('Director', 'Director'),
      )
      role = models.CharField(max_length=8, 
             choices=CELEBRITY_CHOICES)
  
      def __str__(self):
          return self.role
  
  
  class Actor(models.Model):
      GENDER = (
         ('Male', 'Male'),
         ('Female', 'Female'),
      )
      name = models.CharField(max_length=200)
      rank = models.CharField(max_length=5, default=0)
      gender = models.CharField(max_length=6, choices=GENDER)
      avatar = models.ImageField(upload_to='CelebrityGallery/', 
        blank=True)
      description = models.TextField(blank=True)
      birth_place = models.CharField(max_length=200, blank=True)
      dob = models.DateField(auto_now=False, auto_now_add=False)
      height = models.CharField(max_length=20)
      is_married = models.BooleanField(default=False)
      movies = models.ManyToManyField(
         'movies.Movie', related_name='movies', blank=True)
      celebrity_role = models.ManyToManyField(CelebrityRole)
      created_at = models.DateTimeField(auto_now_add=True)
      updated_at = models.DateTimeField(auto_now=True)
  
      def __str__(self):
         return self.name
  </code></pre>
  <p>Here is my Movie Table</p>
  <pre><code>class Movie(models.Model):
      title = models.CharField(max_length=200)
      year = models.CharField(max_length=25, blank=True)
      description = models.TextField(blank=True)
      released = models.CharField(max_length=25)
      runtime = models.CharField(max_length=25)
      language = models.CharField(max_length=255)
      country = models.CharField(max_length=100)
      metascore = models.CharField(max_length=5, blank=True)
      imdb_id = models.CharField(max_length=10, blank=False, 
          unique=True, default='tt3032400')
      imdb_rating = models.CharField(max_length=5, blank=True)
      imdb_votes = models.CharField(max_length=100, blank=True)
      budget = models.CharField(max_length=25)
      box_office = models.CharField(max_length=25, blank=True)
      imdb_original = models.BooleanField(default=False)
      type = models.CharField(max_length=10, blank=True)
      season = models.CharField(max_length=2, default=0, 
            blank=True)
      episode = models.CharField(max_length=3, default=0, 
             blank=True)
      poster_url = models.ImageField(upload_to='Posters/', 
           blank=True)
      video_poster_url = 
      models.ImageField(upload_to='VideoPosters/', blank=True)
      video_url = models.TextField(validators=[URLValidator()], 
            blank=True, max_length=2000)
      genre = models.ManyToManyField(Genre, 
                    related_name='genre_movies')
      image_gallery = models.ManyToManyField(ImageGallery, 
                blank=True)
      video_gallery = models.ManyToManyField(VideoGallery, 
             blank=True)
      director = models.ManyToManyField(Actor, 
           related_name='director')
      writer = models.ManyToManyField(Actor, 
              related_name='writer')
      actors = models.ManyToManyField(Actor, 
           related_name='actors')
      producer = models.ManyToManyField(Actor, 
           related_name='producer')
  
      def __str__(self):
          return self.title
  </code></pre>
  <p><a href="https://i.stack.imgur.com/IESbs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IESbs.jpg" alt="enter image description here" /></a></p>