The Django doc tell me how to add an option to my django custom management command, via an example:
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--delete',
action='store_true',
dest='delete',
default=False,
help='Delete poll instead of closing it'),
)
Then the docs just stop. How would one write the handle
method for this class to check whether the user has supplied a --delete
option? At times Django makes the easy things difficult :-(
del
.delete
is permitted as a variable name. – Forever