Update RelationCounterField to support newer versions of Django.
Review Request #10254 — Created Oct. 21, 2018 and submitted — Latest diff uploaded
Newer versions of Django changed the names used to access some state on
models. This change updatesRelationCounterField
to work with those
changes, fetching the right attributes for the right versions of Django.
It does this through inspecting the available attributes, rather than
assuming anything about the version.
Unit tests pass on Django 1.6 and 1.11.