Reputation: 31
I have a wagtail Page model like:
class PropertyPage(Page):
...
categories = ParentalManyToManyField('property.PropertyCategory', blank=True)
Is it possible to have a query param to filter multiple values base on it?
/api/v2/pages/?type=property.PropertyPage&categories=1,2,3,...
right now I get this error:
"message": "query parameter is not an operation or a recognised field: categories"
}
Upvotes: 1
Views: 529
Reputation: 31
So, my requirement was to filter a "ParentalManyToManyField" by multiple value and it can be done by query params in this format:
/api/v2/pages/?type=property.PropertyPage&categories=1&categories=2&...
Upvotes: 1