def _get_count(queryset):
try:<EOL><INDENT>return queryset.count()<EOL><DEDENT>except (AttributeError, TypeError, DatabaseError):<EOL><INDENT>return len(queryset)<EOL><DEDENT>
Determine an object count, supporting either querysets or regular lists.