Commit 57f2b925 authored by jtchilders's avatar jtchilders
Browse files

deleting file

parent 78a2c52d
from import BaseCommand, CommandError
from django.conf import settings
from balsam import models
import logging
logger = logging.getLogger('console')
class Command(BaseCommand):
help = 'Remove BalsamJobs'
def add_arguments(self, parser):
# Positional arguments
parser.add_argument('--pk', nargs='+', type=int,help='remove the specified jobs.',required=True)
def handle(self, *args, **options):
if options['pk'] is not None:
jobs = models.BalsamJob.objects.filter(pk__in=options['pk'])
for job in jobs:'About to delete BalsamJob pk = ' + str( + ' \n' + str(job))
answer = raw_input(' Enter "yes" to continue: ')
if answer == 'yes':
job.delete()'BalsamJob deleted')
else:'BalsamJob not deleted')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment