

def as_sql(self):
    '\n        Creates the SQL for this query. Returns the SQL string and list of\n        parameters.\n        '
    assert (len(self.query.tables) == 1), 'Can only delete from one table at a time.'
    qn = self.quote_name_unless_alias
    result = [('DELETE FROM %s' % qn(self.query.tables[0]))]
    (where, params) = self.query.where.as_sql(qn=qn, connection=self.connection)
    if where:
        result.append(('WHERE %s' % where))
    return (' '.join(result), tuple(params))

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/models/sql/compiler.py SQLDeleteCompiler.as_sql/original