def _get_count(queryset):
 try:
  return queryset.count()
 except (AttributeError, TypeError):
  return len(queryset)

def _get_count ( queryset ) : try : return queryset . count ( ) except ( AttributeError , TypeError ) : return len ( queryset )
determine an object count .