#32667 closed Cleanup/optimization (fixed)
Clarify about tags on BaseCommand.require_system_checks
| Reported by: | Abhyudai | Owned by: | Abhyudai |
|---|---|---|---|
| Component: | Core (System checks) | Version: | 3.2 |
| Severity: | Normal | Keywords: | documentation |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
The current documentation regarding requires_system_checks mention Tags but it isn't very clear where Tags come from. I'm just quoting the documentation here for easy of conversation.
A list or tuple of tags, e.g. [Tags.staticfiles, Tags.models]. System checks registered in the chosen tags will be checked for errors prior to executing the command. The value 'all' can be used to specify that all system checks should be performed. Default value is 'all'.
I didn't exactly find a definition on that page.
Digging into the source, I found that Tags actually come from django.core.registry.check. I think it would be worthwhile mentioning the actual reference here. I could potentially make the documentation more clear.
If acceptable, I would be willing to make the patch for it.
Change History (5)
comment:1 by , 5 years ago
| Component: | Documentation → Core (System checks) |
|---|---|
| Keywords: | documentation added |
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 5 years ago
| Owner: | changed from to |
|---|
IMO it should be enough to add a link to the Registering and labeling checks, e.g.
diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt index 5d1a8ddd2d..e80540afaa 100644 --- a/docs/howto/custom-management-commands.txt +++ b/docs/howto/custom-management-commands.txt @@ -218,9 +218,10 @@ All attributes can be set in your derived class and can be used in .. attribute:: BaseCommand.requires_system_checks A list or tuple of tags, e.g. ``[Tags.staticfiles, Tags.models]``. System - checks registered in the chosen tags will be checked for errors prior to - executing the command. The value ``'__all__'`` can be used to specify - that all system checks should be performed. Default value is ``'__all__'``. + checks :ref:`registered in the chosen tags <registering-labeling-checks>` + will be checked for errors prior to executing the command. The value + ``'__all__'`` can be used to specify that all system checks should be + performed. Default value is ``'__all__'``. .. versionchanged:: 3.2 diff --git a/docs/topics/checks.txt b/docs/topics/checks.txt index 438139ad31..1a5594fc27 100644 --- a/docs/topics/checks.txt +++ b/docs/topics/checks.txt @@ -77,6 +77,8 @@ implied by the class name. * :class:`Error` * :class:`Critical` +.. _registering-labeling-checks: + Registering and labeling checks -------------------------------