If the field we are currently working on has too many objects related to it, we want to restrict it
        depending on a settings-driven threshold.
        :param objects: The objects we want to filter
        :param current_obj: The current collected instance
        :param field_name: The current field name
        :return:

def filter_by_threshold(self, objects, current_instance, field_name):
        """
        If the field we are currently working on has too many objects related to it, we want to restrict it
        depending on a settings-driven threshold.
        :param objects: The objects we want to filter
        :param current_obj: The current collected instance
        :param field_name: The current field name
        :return:
        """
        objs_count = len(objects)
        if objs_count == 0:
            return []
        object_example = objects[0]

        related_model_name = get_model_from_instance(object_example)
        max_count = self.get_maximum_allowed_instances_for_model(related_model_name)
        if objs_count > max_count:
            self.emit_event(type='too_many_related_objects', obj=current_instance, related_model=related_model_name)
            self.add_excluded_field(get_key_from_instance(current_instance), field_name,
                                    related_model_name, objs_count, max_count)
            return []

        return objects