app/django/core/management/commands/sqlclear.py
author Sverre Rabbelier <srabbelier@gmail.com>
Mon, 10 Nov 2008 00:41:54 +0000
changeset 459 2cfcedaf7c16
parent 323 ff1a9aa48cfd
permissions -rw-r--r--
Preparation for generic user views Added a getSuffixValues method that is meant to allow for having a non-public field as key_name. Also added support for a key-name field being embeded in the form so that if the key-fields change the old key_name is not lost.

from django.core.management.base import AppCommand

class Command(AppCommand):
    help = "Prints the DROP TABLE SQL statements for the given app name(s)."

    output_transaction = True

    def handle_app(self, app, **options):
        from django.core.management.sql import sql_delete
        return u'\n'.join(sql_delete(app, self.style)).encode('utf-8')