Skip to content
Advertisement

Django search returning Exception Value: object of type ‘method’ has no len()

Pretty new to Django Rest Framework and I’m not quite sure how to debug this error at the moment. When I set a breakpoint in the view search view. I see all my products in results

JavaScript

Pagination is set in settings.py

JavaScript

Search view

JavaScript

Products view

JavaScript

Products model

JavaScript

Below is the full trace of my error

JavaScript

Advertisement

Answer

You are missing () when trying to call .distinct() method in search()

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement