PageRenderTime 27ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/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
Possible License(s): BSD-3-Clause
  1. from django.core.management.base import BaseCommand
  2. from optparse import make_option
  3. class Command(BaseCommand):
  4. option_list = BaseCommand.option_list + (
  5. make_option('--option_a','-a', action='store', dest='option_a', default='1'),
  6. make_option('--option_b','-b', action='store', dest='option_b', default='2'),
  7. make_option('--option_c','-c', action='store', dest='option_c', default='3'),
  8. )
  9. help = 'Test basic commands'
  10. requires_model_validation = False
  11. args = '[labels ...]'
  12. def handle(self, *labels, **options):
  13. print 'EXECUTE:BaseCommand labels=%s, options=%s' % (labels, sorted(options.items()))