diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-01-26 12:45:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-26 12:45:07 +0100 |
| commit | 305757aec19c9d5111e4d76095ae0acd66163e4b (patch) | |
| tree | 04aa017e66c06b3b19cb466ed4e1d73cd871523d /docs/ref | |
| parent | 3f6d939c62efd967f548c27a265748cc2cc47ca5 (diff) | |
Applied Black's 2024 stable style.
https://github.com/psf/black/releases/tag/24.1.0
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 9 | ||||
| -rw-r--r-- | docs/ref/contrib/gis/feeds.txt | 12 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 3 | ||||
| -rw-r--r-- | docs/ref/utils.txt | 12 |
4 files changed, 12 insertions, 24 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 23cfa833e0..e85ba9c36a 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -751,8 +751,7 @@ subclass:: like:: @admin.display(ordering="-first_name") - def colored_first_name(self): - ... + def colored_first_name(self): ... The ``ordering`` argument supports query lookups to sort by values on related models. This example includes an "author first name" column in @@ -3128,8 +3127,7 @@ returns a site instance. from django.contrib import admin - class MyAdminSite(admin.AdminSite): - ... + class MyAdminSite(admin.AdminSite): ... .. code-block:: python :caption: ``myproject/apps.py`` @@ -3467,5 +3465,4 @@ The ``staff_member_required`` decorator @staff_member_required - def my_view(request): - ... + def my_view(request): ... diff --git a/docs/ref/contrib/gis/feeds.txt b/docs/ref/contrib/gis/feeds.txt index 9ae9d4f03a..3f17a68574 100644 --- a/docs/ref/contrib/gis/feeds.txt +++ b/docs/ref/contrib/gis/feeds.txt @@ -40,18 +40,14 @@ API Reference item_geometry = ... # Also a function with no arguments - def geometry(self): - ... + def geometry(self): ... - def item_geometry(self): - ... + def item_geometry(self): ... # And as a function with a single argument - def geometry(self, obj): - ... + def geometry(self, obj): ... - def item_geometry(self, item): - ... + def item_geometry(self, item): ... .. method:: geometry(obj) diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index eee1c66d56..9db029cc60 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -422,8 +422,7 @@ A dotted path to the view function to be used when an incoming request is rejected by the :doc:`CSRF protection </ref/csrf>`. The function should have this signature:: - def csrf_failure(request, reason=""): - ... + def csrf_failure(request, reason=""): ... where ``reason`` is a short message (intended for developers or logging, not for end users) indicating the reason the request was rejected. It should return diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 8ebb4f5116..3e357cba17 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -469,8 +469,7 @@ https://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004 class Person(models.Model): @cached_property - def friends(self): - ... + def friends(self): ... Note that as the method is now a property, in Python code it will need to be accessed appropriately:: @@ -552,8 +551,7 @@ https://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004 # Or more succinctly: @keep_lazy(str) - def fancy_utility_function(s, *args, **kwargs): - ... + def fancy_utility_function(s, *args, **kwargs): ... The ``keep_lazy()`` decorator takes a number of extra arguments (``*args``) specifying the type(s) that the original function can return. A common @@ -578,14 +576,12 @@ https://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004 # Our previous example was: @keep_lazy(str) - def fancy_utility_function(s, *args, **kwargs): - ... + def fancy_utility_function(s, *args, **kwargs): ... # Which can be rewritten as: @keep_lazy_text - def fancy_utility_function(s, *args, **kwargs): - ... + def fancy_utility_function(s, *args, **kwargs): ... ``django.utils.html`` ===================== |
