Update RelationCounterField to support newer versions of Django.

Review Request #10254 — Created Oct. 21, 2018 and submitted — Latest diff uploaded

Information

Djblets
release-2.0.x
306f15f...

Reviewers

Newer versions of Django changed the names used to access some state on
models. This change updates RelationCounterField 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.