              to_many=True,
              # manytomany do not have to_fields
              to_field=None,
              has_through_model=(
                  not get_remote_field(field).through._meta.auto_created
              ),
              reverse=False
          )
  
      return forward_relations
 
</s> remove                 (getattr(get_remote_field(relation.field), 'through', None) is not None) and
                not get_remote_field(relation.field).through._meta.auto_created
 </s> add                 (getattr(relation.field.remote_field, 'through', None) is not None) and
                not relation.field.remote_field.through._meta.auto_created </s> remove             related_model=get_related_model(field),
 </s> add             related_model=field.remote_field.model, </s> remove             related_model=get_related_model(field),
 </s> add             related_model=field.remote_field.model, </s> remove     if isinstance(model_field, models.TextField) or (JSONField and isinstance(model_field, JSONField)):
 </s> add     if isinstance(model_field, models.TextField) or (postgres_fields and isinstance(model_field, postgres_fields.JSONField)): </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):
                not field.remote_field.through._meta.auto_created
              to_many=True,
              # manytomany do not have to_fields
              to_field=None,
              has_through_model=(
                not field.remote_field.through._meta.auto_created
              ),
              reverse=False
          )
  
      return forward_relations
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