rel.to is removed in Django 2.0. For backwards compatibility I check first for remote_field (the updated name for the same property) then fall back on .rel.to. .remote_field is supported from Django 1.9+. I also replaced one call to ._meta.get_field_by_name(…)[0] to ._meta.get_field(…) as it does the same thing and get_field_by_name is no longer supported.
Coverage decreased (-1.07%) to 70.566% when pulling ed03de35a8889574bb3cb562a5efd2c279ddb7fb on JordanReiter:RelToRemovedInDjango20 into b356f21dfb0686fb6dfad6144d6fd86e35b9cd26 on ecometrica:master.
Coverage decreased (-0.8%) to 70.823% when pulling ed03de35a8889574bb3cb562a5efd2c279ddb7fb on JordanReiter:RelToRemovedInDjango20 into b356f21dfb0686fb6dfad6144d6fd86e35b9cd26 on ecometrica:master.
rel.to is removed in Django 2.0. For backwards compatibility I check first for remote_field (the updated name for the same property) then fall back on .rel.to. .remote_field is supported from Django 1.9+. I also replaced one call to
._meta.get_field_by_name(…)[0]
to._meta.get_field(…)
as it does the same thing andget_field_by_name
is no longer supported.