我有一个修饰器,它应该使用从命令行传入的参数
@deco(name)
def handle(self, *_args, **options):
name = options["name"]
def deco(name):
// The name should come from commandline
pass
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
"--name",
type=str,
required=True,
)
@deco(//How can I pass the name here?)
def handle(self, *_args, **options):
name = options["name"]
对此有何建议?