summaryrefslogtreecommitdiff
path: root/docs/ref/applications.txt
diff options
context:
space:
mode:
authorTom Forbes <tom@tomforb.es>2020-07-12 13:59:57 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-12-15 11:25:46 +0100
commitb5e12d490af3debca8c55ab3c1698189fdedbbdb (patch)
tree5fe3005ac567f3addf78b81ae033191e2fa642f4 /docs/ref/applications.txt
parentb960e4ed722a04a9db0d35293f76e253eedf9126 (diff)
Fixed #31007 -- Allowed specifying type of auto-created primary keys.
This also changes the default type of auto-created primary keys for new apps and projects to BigAutoField.
Diffstat (limited to 'docs/ref/applications.txt')
-rw-r--r--docs/ref/applications.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/applications.txt b/docs/ref/applications.txt
index 765e9e8d3c..2cf175e9f0 100644
--- a/docs/ref/applications.txt
+++ b/docs/ref/applications.txt
@@ -90,6 +90,7 @@ would provide a proper name for the admin::
from django.apps import AppConfig
class RockNRollConfig(AppConfig):
+ default_auto_field = 'django.db.models.BigAutoField'
name = 'rock_n_roll'
verbose_name = "Rock ’n’ roll"
@@ -219,6 +220,16 @@ Configurable attributes
By default, this attribute isn't set.
+.. attribute:: AppConfig.default_auto_field
+
+ .. versionadded:: 3.2
+
+ The implicit primary key type to add to models within this app. You can
+ use this to keep :class:`~django.db.models.AutoField` as the primary key
+ type for third party applications.
+
+ By default, this is the value of :setting:`DEFAULT_AUTO_FIELD`.
+
Read-only attributes
--------------------