ModelViewSet lookup_field

In section 6 - ViewSets I’m trying to access the Detail view using a uuid field rather than the default pk but I receive a 404 error when trying to access an instance using uuid. I tried setting lookup_field = ‘uuid’ in both my view and serializer to no avail.

In the next section “Designing and implementing a shopping cart API”
chapter “3- Revisiting the data model”, Mosh explains the implementation of uuid fields.

Thanks for the heads up!

1 Like