#32153: Support for list arguments inside exclusive required groups
-------------------------------------+-------------------------------------
Reporter: Mark Gajdosik | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
Keywords: call_command, | Triage Stage:
exclusive group, nargs, error | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mark Gajdosik):
Replying to [comment:3 Hasan Ramezani]:
> I think we need to add proper handling for `required` arguments with
`nargs` as well.
That would always be neat. I couldn't get it to work with the current
{}={} syntax and the list comprehension:
{{{
# Any required arguments which are passed in via **options must be passed
# to parse_args().
for opt in parser_actions:
if (
opt.dest in options and
(opt.required or opt in mutually_exclusive_required_options)
):
parse_args.append(min(opt.option_strings))
value = arg_options[opt.dest]
if isinstance(value, (list, tuple)):
parse_args += map(str, value)
else:
parse_args.append(str(value))
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32153#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.9ed566410e045bb32b84d4fa1b614050%40djangoproject.com.