Closes #15131: Dynamic queryset annotations for REST API endpoints
Closes: #15131
- Introduce the new
RelatedObjectCountField class to represent annotated counts
- Update all model serializers to use
RelatedObjectCountField for related counts instead of IntegerField
- Introduce
get_annotations_for_serializer() utility function for automatically resolving the required annotations for a request
- Remove static annotations from REST API view querysets
- Remove obsolete annotations cleanup logic from
BriefModeMixin