mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
Django 1.10: Use add_argument for options in BaseCommand.
This commit is contained in:
@@ -9,7 +9,7 @@ from optparse import make_option
|
||||
|
||||
from django.test import Client
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.core.management.base import BaseCommand, CommandParser
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
@@ -22,16 +22,19 @@ Example:
|
||||
|
||||
"""
|
||||
|
||||
option_list = BaseCommand.option_list + (
|
||||
make_option('-f', '--fixture',
|
||||
dest='fixture',
|
||||
type='str',
|
||||
help='The path to the fixture you\'d like to send into Zulip'),
|
||||
make_option('-u', '--url',
|
||||
dest='url',
|
||||
type='str',
|
||||
help='The url on your Zulip server that you want to post the fixture to'),
|
||||
)
|
||||
def add_arguments(self, parser):
|
||||
# type: (CommandParser) -> None
|
||||
parser.add_argument('-f', '--fixture',
|
||||
dest='fixture',
|
||||
type=str,
|
||||
help='The path to the fixture you\'d like to send '
|
||||
'into Zulip')
|
||||
|
||||
parser.add_argument('-u', '--url',
|
||||
dest='url',
|
||||
type=str,
|
||||
help='The url on your Zulip server that you want '
|
||||
'to post the fixture to')
|
||||
|
||||
def handle(self, **options):
|
||||
# type: (*Any, **str) -> None
|
||||
|
||||
Reference in New Issue
Block a user