Skip to content

Commit 6cb6b02

Browse files
committed
Reference typos in fields.md
1 parent aa131ae commit 6cb6b02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/api-guide/fields.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ A field class that does not take a value based on user input, but instead takes
434434

435435
For example, to include a field that always provides the current time as part of the serializer validated data, you would use the following:
436436

437-
modified = serializer.HiddenField(default=timezone.now)
437+
modified = serializers.HiddenField(default=timezone.now)
438438

439439
The `HiddenField` class is usually only needed if you have some validation that needs to run based on some pre-provided field values, but you do not want to expose all of those fields to the end user.
440440

@@ -481,7 +481,7 @@ If you want to create a custom field, you'll need to subclass `Field` and then o
481481

482482
The `.to_representation()` method is called to convert the initial datatype into a primitive, serializable datatype.
483483

484-
The `to_internal_value()` method is called to restore a primitive datatype into its internal python representation. This method should raise a `serializer.ValidationError` if the data is invalid.
484+
The `to_internal_value()` method is called to restore a primitive datatype into its internal python representation. This method should raise a `serializers.ValidationError` if the data is invalid.
485485

486486
Note that the `WritableField` class that was present in version 2.x no longer exists. You should subclass `Field` and override `to_internal_value()` if the field supports data input.
487487

0 commit comments

Comments
 (0)