Not updated docs ? : Creating a ModelSerializer without either the 'fields' attribute or the 'exclude' attribute has been deprecated since 3.3.0 #8242
-
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 = Account When 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 ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Ah good spot, thanks. Looks like it needs updating, yup. You're welcome to open a pull request adding |
Beta Was this translation helpful? Give feedback.
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. 👍