~canonical-django/canonical-django/project-template

« back to all changes in this revision

Viewing changes to trunk/python-packages/django/core/management/commands/sqlflush.py

  • Committer: Matthew Nuzum
  • Date: 2008-11-13 05:46:03 UTC
  • Revision ID: matthew.nuzum@canonical.com-20081113054603-v0kvr6z6xyexvqt3
adding to version control

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from django.core.management.base import NoArgsCommand
 
2
 
 
3
class Command(NoArgsCommand):
 
4
    help = "Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed."
 
5
 
 
6
    output_transaction = True
 
7
 
 
8
    def handle_noargs(self, **options):
 
9
        from django.core.management.sql import sql_flush
 
10
        return u'\n'.join(sql_flush(self.style, only_django=True)).encode('utf-8')