code: def get_unique_together_validators(self):
          
          model_class_inheritance_tree = (
              [self.Meta.model] +
              list(self.Meta.model._meta.parents.keys())
          )
  
          # The field names we're passing though here only include fields
          # which may map onto a model field. Any dotted field name lookups
          # cannot map to a field, and must be a traversal, so we're not
          # including those.
          field_names = {
              field.source for field in self.fields.values()
              if (field.source != '*') and ('.' not in field.source)
          }
  
          # Note that we make sure to check `unique_together` both on the
          # base model class, but also on any parent classes.
          validators = []
          for parent_class in model_class_inheritance_tree:
              for unique_together in parent_class._meta.unique_together:
                  if field_names.issuperset(set(unique_together)):
                      validator = UniqueTogetherValidator(
                          queryset=parent_class._default_manager,
                          fields=unique_together
                      )
                      validators.append(validator)
          return validators
docs: Determine a default set of validators for any unique_together contraints.