#33205: call_command() fails when required mutually exclusive arguments use the
same `dest`.
-------------------------------------+-------------------------------------
Reporter: Peter Law | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak):
Replying to [comment:2 Hasan Ramezani]:
> I don't know do we have to support passing both dest and arg name as
keyword arguments? in the example of this ticket, if we call
`management.call_command('pause', until='1')`, it should be considered as
`until` arg or `for` (because `dest` of `for` is `until` as well)
We should support option names as
[https://docs.djangoproject.com/en/3.2/ref/django-
admin/#django.core.management.call_command documented]:
> `** options`
> named options accepted on the command-line.
so
* `management.call_command('pause', until='1')` should work the same as
calling `pause --until 1`
* `management.call_command('pause', **{'for': '1'})` should work the same
as calling `pause --for 1`
* `management.call_command('pause', **{'for': '1', 'until': '1'})` should
work the same as calling `pause --for 1 --until 1` and raise an exception
--
Ticket URL: <https://code.djangoproject.com/ticket/33205#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/068.6616287e02df3da1aa1d9327bf8244b9%40djangoproject.com.