from rest_framework import serializers
from ..models import FAQ
class FAQSerializer(serializers.ModelSerializer):
class Meta:
model = FAQ
fields = (
"id",
"question",
"answer",
)
When I open the above file in Visual Studio Code (latest version, which is 1.95.0), Meta is underlined in red. Hovering over it shows the following error:
"Meta" overrides symbol of same name in class "ModelSerializer"
"project.faqs.api.serializers.FAQSerializer.Meta" is not assignable to "rest_framework.serializers.ModelSerializer.Meta"
Type "type[project.faqs.api.serializers.FAQSerializer.Meta]" is not assignable to type "type[rest_framework.serializers.ModelSerializer.Meta]" Pylance(reportIncompatibleVariableOverride)
serializers.pyi(197, 11): Overridden symbol
I'm using djangorestframework-stubs==3.15.1. Am I doing something wrong?
This is my code:
When I open the above file in Visual Studio Code (latest version, which is 1.95.0),
Meta
is underlined in red. Hovering over it shows the following error:I'm using
djangorestframework-stubs==3.15.1
. Am I doing something wrong?