@@ -0,0 +1,1238 @@
+import sys%0Afrom optparse import make_option%0Afrom django.core.management.base import NoArgsCommand%0Afrom ...models import Release, Category, Entry, EntryLineItem%0A%0Aclass Command(NoArgsCommand):%0A    help = 'Delete existing declarations of members interests - allows for subsequent re-importing of data.'%0A%0A    option_list = NoArgsCommand.option_list + (%0A        make_option(%0A            '--commit',%0A            action='store_true',%0A            dest='commit',%0A            help='Actually update the database'),)%0A%0A    def handle_noargs(self, **options):%0A        count_releases = Release.objects.count()%0A        count_categories = Category.objects.count()%0A        count_entries = Entry.objects.count()%0A        count_entrylineitems = EntryLineItem.objects.count()%0A%0A        print %22  Deleting%22, count_releases, %22releases%22%0A        print %22  Deleting%22, count_categories, %22categories%22%0A        print %22  Deleting%22, count_entries, %22entries%22%0A        print %22  Deleting%22, count_entrylineitems, %22entrylineitems%5Cn%22%0A%0A        if options%5B'commit'%5D:%0A            print %22  Executing the delete%22%0A            Release.objects.all().delete()%0A            Category.objects.all().delete()%0A        else:%0A            print %22  Not executing the delete (--commit not specified)%22%0A

Add members interests delete existing command