Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
API search for facility and pagination #921
Thanks again for the healthsites project, we really love it at HDX.
I was testing the API and how to search for healthsites by name or placename and found something odd.
However, when you search healthsites by name, it looks like the pagination doesn't work. For example, this query gives all the healthsites with "chu" in their name (689 healthsites as of 25th April 2017)
I also want to add that it would be great if we can have the number of page in the metadata, a kind of summary or a limit parameter to control the number of healthsites we want per page. I think it is quite related to #920
Thanks again and let me know how I can help
Not sure, but I think we need to modify this part:
Using the same approach for placename i.e:
Let me know if I can do something to help
Just to be sure that we are saying the same thing, shoudl this be sufficient ?
elif search_type == "facility": facilities = Locality.objects.filter(name__icontains=place_name) if self.page: facilities = self.get_query_by_page(facilities, self.page) else: facilities = facilities[:100] facilities = self.query_to_json(facilities, self.format) return self.api_response(facilities)
If yes I can add it ASAP.