mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Adjusted verbiage in tutorial, part 1, ModelSerializers class.
This commit is contained in:
parent
4d9e7a5356
commit
8c91fb5d4e
|
@ -191,7 +191,7 @@ Our `SnippetSerializer` class is replicating a lot of information that's also co
|
|||
In the same way that Django provides both `Form` classes and `ModelForm` classes, REST framework includes both `Serializer` classes, and `ModelSerializer` classes.
|
||||
|
||||
Let's look at refactoring our serializer using the `ModelSerializer` class.
|
||||
Open the file `snippets/serializers.py` again, and edit the `SnippetSerializer` class.
|
||||
Open the file `snippets/serializers.py` again, and replace the `SnippetSerializer` class with the following.
|
||||
|
||||
class SnippetSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
|
|
Loading…
Reference in New Issue
Block a user