  
  def manager_repr(value):
      model = value.model
      opts = model._meta
      for manager_name, manager_instance in get_names_and_managers(opts):
          if manager_instance == value:
              return '%s.%s.all()' % (model._meta.object_name, manager_name)
      return repr(value)
  
  
 
</s> remove from rest_framework.compat import get_names_and_managers, unicode_repr
 </s> add from rest_framework.compat import unicode_repr </s> remove     for field in [field for field in opts.fields if field.serialize and not get_remote_field(field)]:
 </s> add     for field in [field for field in opts.fields if field.serialize and not field.remote_field]: </s> remove     for field in [field for field in opts.fields if field.serialize and get_remote_field(field)]:
 </s> add     for field in [field for field in opts.fields if field.serialize and field.remote_field]: </s> remove             related_model=get_related_model(field),
 </s> add             related_model=field.remote_field.model, </s> remove         if is_authenticated(request.user):
 </s> add         if request.user.is_authenticated:
    names_and_managers = [
        (manager.name, manager)
        for manager
        in opts.managers
    ]
    for manager_name, manager_instance in names_and_managers:
  
  def manager_repr(value):
      model = value.model
      opts = model._meta
    names_and_managers = [
        (manager.name, manager)
        for manager
        in opts.managers
    ]
    for manager_name, manager_instance in names_and_managers:
          if manager_instance == value:
              return '%s.%s.all()' % (model._meta.object_name, manager_name)
      return repr(value)
  
  
keep keep keep keep replace keep keep keep keep keep
 Remove Django 1.8 & 1.9 compatibility code (#5481)

* Identify code that needs to be pulled out of/removed from compat.py

* Extract modern code from get_names_and_managers in compat.py and remove compat code

* Extract modern code from is_authenticated() in compat.py and remove.

* Extract modern code from is_anonymous() in compat.py and remove

* Extract modern code from get_related_model() from compat.py and remove

* Extract modern code from value_from_object() in compat.py and remove

* Update postgres compat

JSONField now always available.

* Remove DecimalValidator compat

* Remove get_remote_field compat

* Remove template_render compat

Plus isort.

* Remove set_many compat

* Remove include compat 
rest_framework/utils/representation.py