~ubuntu-branches/ubuntu/saucy/python-django/saucy-updates

« back to all changes in this revision

Viewing changes to tests/regressiontests/admin_scripts/management/commands/base_command.py

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2008-11-15 19:15:33 UTC
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: james.westby@ubuntu.com-20081115191533-84v2zyjbmp1074ni
Tags: upstream-1.0.1
ImportĀ upstreamĀ versionĀ 1.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from django.core.management.base import BaseCommand
2
 
from optparse import make_option
3
 
# Python 2.3 doesn't have sorted()
4
 
try:
5
 
    sorted
6
 
except NameError:
7
 
    from django.utils.itercompat import sorted
8
 
 
9
 
class Command(BaseCommand):
10
 
    option_list = BaseCommand.option_list + (
11
 
        make_option('--option_a','-a', action='store', dest='option_a', default='1'),
12
 
        make_option('--option_b','-b', action='store', dest='option_b', default='2'),
13
 
        make_option('--option_c','-c', action='store', dest='option_c', default='3'),
14
 
    )
15
 
    help = 'Test basic commands'
16
 
    requires_model_validation = False
17
 
    args = '[labels ...]'
18
 
 
19
 
    def handle(self, *labels, **options):
20
 
        print 'EXECUTE:BaseCommand labels=%s, options=%s' % (labels, sorted(options.items()))