Repository navigation
Not updated docs ? : Creating a ModelSerializer without either the 'fields' attribute or the 'exclude' attribute has been deprecated since 3.3.0 #8242
Answered
by
lovelydinosaur
Guilouf
asked this question in
Potential Issue
|
But in the docs, there is this paragraph https://github.com/encode/django-rest-framework/blob/master/docs/api-guide/serializers.md#specifying-fields-explicitly, where obviously there is no class AccountSerializer(serializers.ModelSerializer):
url = serializers.CharField(source='get_absolute_url', read_only=True)
groups = serializers.PrimaryKeyRelatedField(many=True)
class Meta:
model = AccountWhen i try something similar, i get the assertion error Is it an issue with docs not updated ? How to customize a model serializer, with for example renamed fields ? |
Answered by
lovelydinosaur
Nov 9, 2021
Replies: 1 comment 5 replies
|
Ah good spot, thanks. Looks like it needs updating, yup. You're welcome to open a pull request adding |
5 replies
Answer selected by
Guilouf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah good spot, thanks. Looks like it needs updating, yup. You're welcome to open a pull request adding
fields = ...there, or else I'll update it. 👍