1
# Copyright 2010 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
from django.core.management.commands.flush import Command as FlushCommand
5
from django.core.management.color import no_style
8
class Command(FlushCommand):
11
def handle_noargs(self, **options):
12
from django.db import connection
13
from django.core.management.sql import sql_flush
14
self.style = no_style()
15
if self.cached_flush is not None:
16
cursor = connection.cursor()
17
cursor.execute(self.cached_flush)
19
super(Command, self).handle_noargs(**options)
20
# Call sql_flush instead of picking up the raw queries because
22
queries = sql_flush(self.style, only_django=True)
23
Command.cached_flush = ';'.join(queries)