📜  如何设置所需的 drf serialzier - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:42.811000             🧑  作者: Mango

代码示例1
class MySerializer(serializer.Modelserializer):
    class Meta:
        model = MyModel
        fields = ['id', 'title']
        
    extra_kwargs = {
        "title": {"required": False}
    }