#24969: Backwards compatibility for optparse in management commands broken for
overrides.
-------------------------------------+-------------------------------------
Reporter: paul-butcher | Owner: nobody
Type: Uncategorized | Status: closed
Component: Core (Management | Version: 1.8
commands) | Resolution:
Severity: Normal | worksforme
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by paul-butcher):
Replying to [comment:1 timgraham]:
* Reinstate BaseCommand.option_list as it was before
* In `use_argparse`, change the condition (currently `not
bool(self.option_list)`) to `self.option_list == BaseCommand.option_list`.
* In `create_parser`, remove all the individual `add_option` calls,
leaving just the one in the loop.
That way, the old defaulting/overriding behaviour could be maintained.
Another candidate could be to set the conflict_handler to "resolve",
however, that would be a major change to the behaviour (authors of derived
classes may be expecting an OptionConflictError that doesn't come), and
would still only allow derived classes to override, rather than remove the
default options. So, that would be inappropriate.
--
Ticket URL: <https://code.djangoproject.com/ticket/24969#comment:3>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.b4d5af83e4d039d9b359bd2c733e02a5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.