Hi, I'm working on implementing some python in django and trying to write a testing prog to accept a range of values. We'd like to be able to write the commands something like:
manage.py commandfile --values=80:90
I see I can use the make_option args to write something like:
manage.py commandfile --values=80 90
when I set the type to int & the nargs to 2. There should be a way to specify that the separation between the values can be something other than a space but I'm having trouble finding anything. It'd sure make things go easier if I could.
ie:
manage.py commandfile --values=80:90
I see I can use the make_option args to write something like:
manage.py commandfile --values=80 90
when I set the type to int & the nargs to 2. There should be a way to specify that the separation between the values can be something other than a space but I'm having trouble finding anything. It'd sure make things go easier if I could.
ie:
Code:
class Command(NoArgsCommand):
option_list = BaseCommand.option_list + (
make_option('--values', type="int", nargs=2,
default=None, dest='values',
help='Specifies the range of values to add to the db')
)
Comment