              # List of fields to determine uniqueness with
              for attr in unique:
                  if attr not in self.mapping:
                      raise ValueError
          elif isinstance(unique, six.string_types):
              # Only a single field passed in.
              if unique not in self.mapping:
                  raise ValueError
          else:
              raise TypeError('Unique keyword argument must be set with a tuple, list, or string.')
 
</s> remove         if not isinstance(query, six.string_types):
 </s> add         if not isinstance(query, str): </s> remove     if not isinstance(lookup_view, six.string_types):
 </s> add     if not isinstance(lookup_view, str): </s> remove         elif value is None or isinstance(value, six.string_types + (six.memoryview,)):
 </s> add         elif value is None or isinstance(value, (str, memoryview)): </s> remove         if isinstance(self.remote_field.model, six.string_types):
 </s> add         if isinstance(self.remote_field.model, str): </s> remove         if isinstance(srid, six.integer_types) or srid is None:
 </s> add         if isinstance(srid, int) or srid is None:
        elif isinstance(unique, str):
              # List of fields to determine uniqueness with
              for attr in unique:
                  if attr not in self.mapping:
                      raise ValueError
        elif isinstance(unique, str):
              # Only a single field passed in.
              if unique not in self.mapping:
                  raise ValueError
          else:
              raise TypeError('Unique keyword argument must be set with a tuple, list, or string.')
keep keep keep keep replace keep keep keep keep keep
 Refs #23919 -- Removed six.<various>_types usage

Thanks Tim Graham and Simon Charette for the reviews. 
django/contrib/gis/utils/layermapping.py