With the code below, I am able to retrieve data based on id, how can I update this code so I can retrieve data based on fileName instead?
My urls is
urlpatterns = [
path("items/<pk>", SingleUploadItem.as_view()),
]
My views is:
class SingleUploadItem(RetrieveAPIView):
queryset = fileUpload.objects.all()
serializer_class = fileUploadSerializer
My model is
class fileUpload(models.Model):
fileName = models.CharField(max_length=200, unique=True, blank=True)
fileuploadserializer class?fileUploadSerializerorFileUploadSerializer?