  
      def __init__(self, slug_field=None, **kwargs):
          assert slug_field is not None, 'The `slug_field` argument is required.'
          self.slug_field = slug_field
          super(SlugRelatedField, self).__init__(**kwargs)
  
      def to_internal_value(self, data):
          try:
              return self.get_queryset().get(**{self.slug_field: data})
          except ObjectDoesNotExist:
 
</s> remove         super(NullBooleanField, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs) </s> remove         super(HyperlinkedIdentityField, self).__init__(view_name, **kwargs)
 </s> add         super().__init__(view_name, **kwargs) </s> remove         super(PrimaryKeyRelatedField, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs) </s> remove         super(IPAddressField, self).__init__(**kwargs)
 </s> add         super().__init__(**kwargs) </s> remove                 self.error_messages['max_length'].format,
                six.text_type)(max_length=self.max_length)
 </s> add                 self.error_messages['max_length'].format, str)(max_length=self.max_length)
        super().__init__(**kwargs)
  
      def __init__(self, slug_field=None, **kwargs):
          assert slug_field is not None, 'The `slug_field` argument is required.'
          self.slug_field = slug_field
        super().__init__(**kwargs)
  
      def to_internal_value(self, data):
          try:
              return self.get_queryset().get(**{self.slug_field: data})
          except ObjectDoesNotExist:
keep keep keep keep replace keep keep keep keep keep
 Dropped Python 2 compatibility. (#6615)

Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com> 
rest_framework/relations.py