You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`format` - A string representing the output format. If not specified, this defaults to `None`, which indicates that python`datetime` objects should be returned by `to_native`. In this case the datetime encoding will be determined by the renderer.
217
+
*`format` - A string representing the output format. If not specified, this defaults to `None`, which indicates that Python`datetime` objects should be returned by `to_native`. In this case the datetime encoding will be determined by the renderer.
218
218
*`input_formats` - A list of strings representing the input formats which may be used to parse the date. If not specified, the `DATETIME_INPUT_FORMATS` setting will be used, which defaults to `['iso-8601']`.
219
219
220
-
DateTime format strings may either be [python strftime formats][strftime] which explicitly specify the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style datetimes should be used. (eg `'2013-01-29T12:34:56.000000Z'`)
220
+
DateTime format strings may either be [Python strftime formats][strftime] which explicitly specify the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style datetimes should be used. (eg `'2013-01-29T12:34:56.000000Z'`)
221
221
222
222
## DateField
223
223
@@ -227,10 +227,10 @@ Corresponds to `django.db.models.fields.DateField`
*`format` - A string representing the output format. If not specified, this defaults to `None`, which indicates that python`date` objects should be returned by `to_native`. In this case the date encoding will be determined by the renderer.
230
+
*`format` - A string representing the output format. If not specified, this defaults to `None`, which indicates that Python`date` objects should be returned by `to_native`. In this case the date encoding will be determined by the renderer.
231
231
*`input_formats` - A list of strings representing the input formats which may be used to parse the date. If not specified, the `DATE_INPUT_FORMATS` setting will be used, which defaults to `['iso-8601']`.
232
232
233
-
Date format strings may either be [python strftime formats][strftime] which explicitly specify the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style dates should be used. (eg `'2013-01-29'`)
233
+
Date format strings may either be [Python strftime formats][strftime] which explicitly specify the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style dates should be used. (eg `'2013-01-29'`)
234
234
235
235
## TimeField
236
236
@@ -242,10 +242,10 @@ Corresponds to `django.db.models.fields.TimeField`
*`format` - A string representing the output format. If not specified, this defaults to `None`, which indicates that python`time` objects should be returned by `to_native`. In this case the time encoding will be determined by the renderer.
245
+
*`format` - A string representing the output format. If not specified, this defaults to `None`, which indicates that Python`time` objects should be returned by `to_native`. In this case the time encoding will be determined by the renderer.
246
246
*`input_formats` - A list of strings representing the input formats which may be used to parse the date. If not specified, the `TIME_INPUT_FORMATS` setting will be used, which defaults to `['iso-8601']`.
247
247
248
-
Time format strings may either be [python strftime formats][strftime] which explicitly specify the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style times should be used. (eg `'12:34:56.000000'`)
248
+
Time format strings may either be [Python strftime formats][strftime] which explicitly specify the format, or the special string `'iso-8601'`, which indicates that [ISO 8601][iso8601] style times should be used. (eg `'12:34:56.000000'`)
Copy file name to clipboardExpand all lines: docs/api-guide/responses.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
REST framework supports HTTP content negotiation by providing a `Response` class which allows you to return content that can be rendered into multiple content types, depending on the client request.
10
10
11
-
The `Response` class subclasses Django's `SimpleTemplateResponse`. `Response` objects are initialised with data, which should consist of native python primatives. REST framework then uses standard HTTP content negotiation to determine how it should render the final response content.
11
+
The `Response` class subclasses Django's `SimpleTemplateResponse`. `Response` objects are initialised with data, which should consist of native Python primitives. REST framework then uses standard HTTP content negotiation to determine how it should render the final response content.
12
12
13
13
There's no requirement for you to use the `Response` class, you can also return regular `HttpResponse` objects from your views if you want, but it provides a nicer interface for returning Web API responses.
14
14
@@ -22,7 +22,7 @@ Unless you want to heavily customize REST framework for some reason, you should
Unlike regular `HttpResponse` objects, you do not instantiate `Response` objects with rendered content. Instead you pass in unrendered data, which may consist of any python primatives.
25
+
Unlike regular `HttpResponse` objects, you do not instantiate `Response` objects with rendered content. Instead you pass in unrendered data, which may consist of any Python primitives.
26
26
27
27
The renderers used by the `Response` class cannot natively handle complex datatypes such as Django model instances, so you need to serialize the data into primative datatypes before creating the `Response` object.
Copy file name to clipboardExpand all lines: docs/api-guide/serializers.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ will take some serious design work.
8
8
>
9
9
> — Russell Keith-Magee, [Django users group][cite]
10
10
11
-
Serializers allow complex data such as querysets and model instances to be converted to native python datatypes that can then be easily rendered into `JSON`, `XML` or other content types. Serializers also provide deserialization, allowing parsed data to be converted back into complex types, after first validating the incoming data.
11
+
Serializers allow complex data such as querysets and model instances to be converted to native Python datatypes that can then be easily rendered into `JSON`, `XML` or other content types. Serializers also provide deserialization, allowing parsed data to be converted back into complex types, after first validating the incoming data.
12
12
13
13
REST framework's serializers work very similarly to Django's `Form` and `ModelForm` classes. It provides a `Serializer` class which gives you a powerful, generic way to control the output of your responses, as well as a `ModelSerializer` class which provides a useful shortcut for creating serializers that deal with model instances and querysets.
14
14
@@ -57,15 +57,15 @@ We can now use `CommentSerializer` to serialize a comment, or list of comments.
Copy file name to clipboardExpand all lines: docs/api-guide/settings.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -199,49 +199,49 @@ Default: `'format'`
199
199
200
200
#### DATETIME_FORMAT
201
201
202
-
A format string that should be used by default for rendering the output of `DateTimeField` serializer fields. If `None`, then `DateTimeField` serializer fields will return python`datetime` objects, and the datetime encoding will be determined by the renderer.
202
+
A format string that should be used by default for rendering the output of `DateTimeField` serializer fields. If `None`, then `DateTimeField` serializer fields will return Python`datetime` objects, and the datetime encoding will be determined by the renderer.
203
203
204
-
May be any of `None`, `'iso-8601'` or a python[strftime format][strftime] string.
204
+
May be any of `None`, `'iso-8601'` or a Python[strftime format][strftime] string.
205
205
206
206
Default: `None`
207
207
208
208
#### DATETIME_INPUT_FORMATS
209
209
210
210
A list of format strings that should be used by default for parsing inputs to `DateTimeField` serializer fields.
211
211
212
-
May be a list including the string `'iso-8601'` or python[strftime format][strftime] strings.
212
+
May be a list including the string `'iso-8601'` or Python[strftime format][strftime] strings.
213
213
214
214
Default: `['iso-8601']`
215
215
216
216
#### DATE_FORMAT
217
217
218
-
A format string that should be used by default for rendering the output of `DateField` serializer fields. If `None`, then `DateField` serializer fields will return python`date` objects, and the date encoding will be determined by the renderer.
218
+
A format string that should be used by default for rendering the output of `DateField` serializer fields. If `None`, then `DateField` serializer fields will return Python`date` objects, and the date encoding will be determined by the renderer.
219
219
220
-
May be any of `None`, `'iso-8601'` or a python[strftime format][strftime] string.
220
+
May be any of `None`, `'iso-8601'` or a Python[strftime format][strftime] string.
221
221
222
222
Default: `None`
223
223
224
224
#### DATE_INPUT_FORMATS
225
225
226
226
A list of format strings that should be used by default for parsing inputs to `DateField` serializer fields.
227
227
228
-
May be a list including the string `'iso-8601'` or python[strftime format][strftime] strings.
228
+
May be a list including the string `'iso-8601'` or Python[strftime format][strftime] strings.
229
229
230
230
Default: `['iso-8601']`
231
231
232
232
#### TIME_FORMAT
233
233
234
-
A format string that should be used by default for rendering the output of `TimeField` serializer fields. If `None`, then `TimeField` serializer fields will return python`time` objects, and the time encoding will be determined by the renderer.
234
+
A format string that should be used by default for rendering the output of `TimeField` serializer fields. If `None`, then `TimeField` serializer fields will return Python`time` objects, and the time encoding will be determined by the renderer.
235
235
236
-
May be any of `None`, `'iso-8601'` or a python[strftime format][strftime] string.
236
+
May be any of `None`, `'iso-8601'` or a Python[strftime format][strftime] string.
237
237
238
238
Default: `None`
239
239
240
240
#### TIME_INPUT_FORMATS
241
241
242
242
A list of format strings that should be used by default for parsing inputs to `TimeField` serializer fields.
243
243
244
-
May be a list including the string `'iso-8601'` or python[strftime format][strftime] strings.
244
+
May be a list including the string `'iso-8601'` or Python[strftime format][strftime] strings.
**Note**: The `oauth2`python package is badly misnamed, and actually provides OAuth 1.0a support. Also note that packages required for both OAuth 1.0a, and OAuth 2.0 are not yet Python 3 compatible.
46
+
**Note**: The `oauth2`Python package is badly misnamed, and actually provides OAuth 1.0a support. Also note that packages required for both OAuth 1.0a, and OAuth 2.0 are not yet Python 3 compatible.
0 commit comments