I am using the Ultimate Django course. I am up to part 2 Designing and Implementing a Shopping Cart API. It must be me because other people have done it, but I can’t see what is wrong. Thereare only three things to do according to Mosh: Create a View, Create a Serializer and Create a Route. Three simple steps I have done too many times now with the same result. When I Post to create the empty Cart I am greeted with
create() must be implemented.
Which I thought was covered by
class CartViewSet(CreateModelMixin, GenericViewSet):
queryset = Cart.objects.all()
serializer_class = CartSerializer
What have I missed?
id = serializers.UUIDField(read_only=True) class Meta: model = Cart fields = ['id']