1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #27656 -- Updated django.contrib docstring verb style according to PEP 257.

This commit is contained in:
Anton Samarchyan
2017-01-24 15:31:57 -05:00
committed by Tim Graham
parent 3f62d20a9b
commit 5411821e3b
118 changed files with 819 additions and 889 deletions

View File

@@ -5,14 +5,14 @@ from django.utils.deprecation import MiddlewareMixin
class XViewMiddleware(MiddlewareMixin):
"""
Adds an X-View header to internal HEAD requests -- used by the documentation system.
Add an X-View header to internal HEAD requests.
"""
def process_view(self, request, view_func, view_args, view_kwargs):
"""
If the request method is HEAD and either the IP is internal or the
user is a logged-in staff member, quickly return with an x-header
indicating the view function. This is used by the documentation module
to lookup the view function for an arbitrary page.
user is a logged-in staff member, return a responsewith an x-view
header indicating the view function. This is used to lookup the view
function for an arbitrary page.
"""
assert hasattr(request, 'user'), (
"The XView middleware requires authentication middleware to be "

View File

@@ -385,10 +385,11 @@ def get_return_data_type(func_name):
def get_readable_field_data_type(field):
"""Returns the description for a given field type, if it exists,
Fields' descriptions can contain format strings, which will be interpolated
against the values of field.__dict__ before being output."""
"""
Return the description for a given field type, if it exists. Fields'
descriptions can contain format strings, which will be interpolated with
the values of field.__dict__ before being output.
"""
return field.description % field.__dict__