def as_sql(self):
        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)
        result.append('WHERE %s' % where)
        return ' '.join(result), tuple(params)
Handles presence stanzas
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/db/models/sql/compiler.py/SQLDeleteCompiler.as_sql--crossover with--dataset/ETHPy150Open mattlong/hermes/hermes/chatroom.py/Chatroom.on_presence