mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Made it possible to change an application's label in its configuration.
Fixed #21683.
This commit is contained in:
parent
5dfec4e23b
commit
c40209dcc0
8 changed files with 83 additions and 31 deletions
|
@ -114,24 +114,33 @@ Application configuration
|
|||
Configurable attributes
|
||||
-----------------------
|
||||
|
||||
.. attribute:: AppConfig.verbose_name
|
||||
|
||||
Human-readable name for the application, e.g. "Admin".
|
||||
|
||||
If this isn't provided, Django uses ``label.title()``.
|
||||
|
||||
Read-only attributes
|
||||
--------------------
|
||||
|
||||
.. attribute:: AppConfig.name
|
||||
|
||||
Full Python path to the application, e.g. ``'django.contrib.admin'``.
|
||||
|
||||
This attribute defines which application the configuration applies to. It
|
||||
must be set in all :class:`~django.apps.AppConfig` subclasses.
|
||||
|
||||
It must be unique across a Django project.
|
||||
|
||||
.. attribute:: AppConfig.label
|
||||
|
||||
Last component of the Python path to the application, e.g. ``'admin'``.
|
||||
Short name for the application, e.g. ``'admin'``
|
||||
|
||||
This value must be unique across a Django project.
|
||||
This attribute allows relabelling an application when two applications
|
||||
have conflicting labels. It defaults to the last component of ``name``.
|
||||
It should be a valid Python identifier.
|
||||
|
||||
It must be unique across a Django project.
|
||||
|
||||
.. attribute:: AppConfig.verbose_name
|
||||
|
||||
Human-readable name for the application, e.g. "Admin".
|
||||
|
||||
This attribute defaults to ``label.title()``.
|
||||
|
||||
Read-only attributes
|
||||
--------------------
|
||||
|
||||
.. attribute:: AppConfig.path
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue