1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #34140 -- Reformatted code blocks in docs with blacken-docs.

This commit is contained in:
django-bot
2023-02-28 20:53:28 +01:00
committed by Mariusz Felisiak
parent 6015bab80e
commit 14459f80ee
193 changed files with 5797 additions and 4481 deletions

View File

@@ -76,20 +76,22 @@ default value of :setting:`DEFAULT_AUTO_FIELD` will be changed to
To avoid unwanted migrations in the future, either explicitly set
:setting:`DEFAULT_AUTO_FIELD` to :class:`~django.db.models.AutoField`::
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
or configure it on a per-app basis::
from django.apps import AppConfig
class MyAppConfig(AppConfig):
default_auto_field = 'django.db.models.AutoField'
name = 'my_app'
default_auto_field = "django.db.models.AutoField"
name = "my_app"
or on a per-model basis::
from django.db import models
class MyModel(models.Model):
id = models.AutoField(primary_key=True)
@@ -124,13 +126,13 @@ functional indexes on expressions and database functions. For example::
class Meta:
indexes = [
Index(
Lower('first_name'),
Upper('last_name').desc(),
name='first_last_name_idx',
Lower("first_name"),
Upper("last_name").desc(),
name="first_last_name_idx",
),
Index(
F('height') / (F('weight') + Value(5)),
name='calc_idx',
F("height") / (F("weight") + Value(5)),
name="calc_idx",
),
]