def METHOD_NAME(queryset):
    """Deletes objects from the database.
    Given a queryset containing the objects to be deleted, this method will
    either delete all without error, or delete none if there's an error.
    """
    quote_name = connection.ops.quote_name
    pk_list = tuple([obj.pk for obj in queryset])
    primary_key = queryset.model._meta.pk.db_column
    table = queryset.model._meta.db_table
    cursor = connection.cursor()
    sql = "DELETE FROM %(table)s WHERE %(field)s IN %%s" % {
        'table': quote_name(table),
        'field': quote_name(primary_key),
    }
    cursor.execute(sql, (pk_list,))
    return cursor.rowcount