From c40209dcc09f19524fb85251f39a4051491bbec0 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 31 Dec 2013 16:23:42 +0100 Subject: Made it possible to change an application's label in its configuration. Fixed #21683. --- docs/ref/applications.txt | 29 +++++++++++++++++++---------- docs/releases/1.7.txt | 3 +++ 2 files changed, 22 insertions(+), 10 deletions(-) (limited to 'docs') diff --git a/docs/ref/applications.txt b/docs/ref/applications.txt index eadf9895ca..38bf474371 100644 --- a/docs/ref/applications.txt +++ b/docs/ref/applications.txt @@ -114,24 +114,33 @@ Application configuration Configurable attributes ----------------------- -.. attribute:: AppConfig.verbose_name +.. attribute:: AppConfig.name - Human-readable name for the application, e.g. "Admin". + Full Python path to the application, e.g. ``'django.contrib.admin'``. - If this isn't provided, Django uses ``label.title()``. + This attribute defines which application the configuration applies to. It + must be set in all :class:`~django.apps.AppConfig` subclasses. -Read-only attributes --------------------- + It must be unique across a Django project. -.. attribute:: AppConfig.name +.. attribute:: AppConfig.label - Full Python path to the application, e.g. ``'django.contrib.admin'``. + Short name for the application, e.g. ``'admin'`` -.. attribute:: AppConfig.label + 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 - Last component of the Python path to the application, e.g. ``'admin'``. + Human-readable name for the application, e.g. "Admin". + + This attribute defaults to ``label.title()``. - This value must be unique across a Django project. +Read-only attributes +-------------------- .. attribute:: AppConfig.path diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index c17f62aeee..453714b6f1 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -79,6 +79,9 @@ Improvements thus far include: * It is possible to omit ``models.py`` entirely if an application doesn't have any models. +* Applications can be relabeled with the :attr:`~django.apps.AppConfig.label` + attribute of application configurations, to work around label conflicts. + * The name of applications can be customized in the admin with the :attr:`~django.apps.AppConfig.verbose_name` of application configurations. -- cgit v1.3