      forward_relations = OrderedDict()
      for field in [field for field in opts.fields if field.serialize and get_remote_field(field)]:
          forward_relations[field.name] = RelationInfo(
              model_field=field,
              related_model=get_related_model(field),
              to_many=False,
              to_field=_get_to_field(field),
              has_through_model=False,
              reverse=False
          )
 
</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     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             related_model=get_related_model(field),
 </s> add             related_model=field.remote_field.model, </s> remove         # (In Django 1.9+ this differs from previous style)
        if isinstance(model_field, models.DecimalField) and DecimalValidator:
 </s> add         if isinstance(model_field, models.DecimalField): </s> remove     for manager_name, manager_instance in get_names_and_managers(opts):
 </s> add     names_and_managers = [
        (manager.name, manager)
        for manager
        in opts.managers
    ]
    for manager_name, manager_instance in names_and_managers:
            related_model=field.remote_field.model,
      forward_relations = OrderedDict()
      for field in [field for field in opts.fields if field.serialize and get_remote_field(field)]:
          forward_relations[field.name] = RelationInfo(
              model_field=field,
            related_model=field.remote_field.model,
              to_many=False,
              to_field=_get_to_field(field),
              has_through_model=False,
              reverse=False
          )
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/model_meta.py