def _get_count(queryset):
    """Determine an object count, supporting either queryset or regular list. Optimized to use only `id`"""
    try:
        return queryset.values('id').count()
    except (AttributeError, TypeError):
        return len(queryset)
