e.g.
{{{
./manage.py flush --no-initial-data
}}}
needs to be called with
{{{
call_command('flush', load_initial_data=False)
}}}
Maybe the docs (for {{{call_command}}}) should be updated to reflect this.
(Though not sure what advice to give beyond "read the source").
Alternatively, we chould add notes to each option where the names differ,
but that seems messy.
--
Ticket URL: <https://code.djangoproject.com/ticket/19570>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* needs_better_patch: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
At a minimum - this should be documented.
A more complete patch might attempt to support all command line options
for builtin commands with the pattern of dashes replaced with underscores.
--
Ticket URL: <https://code.djangoproject.com/ticket/19570#comment:1>
Comment (by leftmoose):
currently not matching options
{{{
command command line arg option.dest
syncdb --noinput interactive
syncdb --no-initial-data load_initial_data
dumpdata --natural use_natural_keys
dumpdata --all use_base_manager
testserver --noinput interactive
testserver --ipv6 use_ipv6
templates --extension extensions
templates --name files
startproject --extension extensions
startproject --name files
flush --noinput interactive
flush --no-initial-data load_initial_data
startapp --extension extensions
startapp --name files
makemessages --extension extensions
makemessages --ignore ignore_patterns
makemessages --no-default-ignore use_default_ignore_patterns
loaddata --ignorenonexistent ignore
runserver --ipv6 use_ipv6
runserver --nothreading use_threading
runserver --noreload use_reloader
test --noinput interactive
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19570#comment:2>
* has_patch: 0 => 1
Comment:
patch: https://github.com/django/django/pull/624
--
Ticket URL: <https://code.djangoproject.com/ticket/19570#comment:3>
* needs_docs: 0 => 1
Comment:
If we are going with the full mapping - this will need to be documented. I
wouldn't deprecate the original kwargs, but only document the ones that
match the CLI options and describe the - to _ pattern, maybe note that
some commands have some legacy analogs - not entirely sure about that last
bit though.
--
Ticket URL: <https://code.djangoproject.com/ticket/19570#comment:4>
* component: Documentation => Core (Management commands)
--
Ticket URL: <https://code.djangoproject.com/ticket/19570#comment:5>
Comment (by claudep):
I guess the patch I proposed for #22985 would solve this issue, too.
--
Ticket URL: <https://code.djangoproject.com/ticket/19570#comment:6>
Comment (by areski):
I was also working on different approach to solve this ticket which might
now become irrelevant with claudep fix.
I still leave the PR for interest maybe some of you would still want to
see more consistency with the option names.
Here it is https://github.com/django/django/pull/3040
--
Ticket URL: <https://code.djangoproject.com/ticket/19570#comment:7>
* cc: areski (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/19570#comment:8>
* status: new => closed
* resolution: => duplicate
Comment:
Marking as a duplicate given Claude's fix.
--
Ticket URL: <https://code.djangoproject.com/ticket/19570#comment:9>