You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dropapp.py 475B

123456789101112
  1. from django.core.management.base import BaseCommand, CommandError
  2. from django.core.management.commands.sqlclear import Command as SqlClearCommand
  3. class Command(BaseCommand):
  4. args = '<app_name app_name ...>'
  5. help = 'Drops the db tables for the given apps'
  6. def handle(self, *args, **kwargs):
  7. com = SqlClearCommand()
  8. self.stdout.write("SET FOREIGN_KEY_CHECKS=0;\n")
  9. for app_name in args:
  10. self.stdout.write(com.handle(app_name))