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

@@ -298,11 +298,13 @@ For example, in older versions of Django::
from django.contrib import admin
class BaseAdmin(admin.ModelAdmin):
actions = ['a']
actions = ["a"]
class SubAdmin(BaseAdmin):
actions = ['b']
actions = ["b"]
``SubAdmin`` would have actions ``'a'`` and ``'b'``.
@@ -310,7 +312,7 @@ Now ``actions`` follows standard Python inheritance. To get the same result as
before::
class SubAdmin(BaseAdmin):
actions = BaseAdmin.actions + ['b']
actions = BaseAdmin.actions + ["b"]
:mod:`django.contrib.gis`
-------------------------
@@ -342,8 +344,8 @@ In usage like::
from django.utils.functional import cached_property
class A:
class A:
@cached_property
def base(self):
return ...
@@ -358,11 +360,11 @@ Use this instead::
import operator
class A:
class A:
...
alias = property(operator.attrgetter('base'))
alias = property(operator.attrgetter("base"))
Permissions for proxy models
----------------------------