假设我创建了这个视图集:
class UserViewSet(viewsets.ModelViewSet):
queryset = User.objects.all()
serializer_class = UserSerializer
lookup_field = 'username'
和这个路由器:
router.register(r'users', views.UserViewSet)
这个序列化器:
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('username', 'password', 'email')
是否有文档提到默认情况下它是否允许user
接受PUT
、、PARTIAL_UPDATE
和请求?DELETE
LIST
CREATE