PageRenderTime 19ms CodeModel.GetById 13ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/tests/regressiontests/admin_scripts/management/commands/base_command.py

https://code.google.com/p/mango-py/
Python | 15 lines | 13 code | 2 blank | 0 comment | 0 complexity | fc8741896a2b3c48ce46992dde2bb97d MD5 | raw file
 1from django.core.management.base import BaseCommand
 2from optparse import make_option
 3
 4class Command(BaseCommand):
 5    option_list = BaseCommand.option_list + (
 6        make_option('--option_a','-a', action='store', dest='option_a', default='1'),
 7        make_option('--option_b','-b', action='store', dest='option_b', default='2'),
 8        make_option('--option_c','-c', action='store', dest='option_c', default='3'),
 9    )
10    help = 'Test basic commands'
11    requires_model_validation = False
12    args = '[labels ...]'
13
14    def handle(self, *labels, **options):
15        print 'EXECUTE:BaseCommand labels=%s, options=%s' % (labels, sorted(options.items()))