Mike-Heneghan / ALISS

ALISS (A Local Information System for Scotland) is a service to help you find help and support close to you when you need it most.
https://aliss.org
0 stars 0 forks source link

Provide an API end-point for querying postcode by place name #65

Closed digitalWestie closed 5 years ago

digitalWestie commented 5 years ago

A new endpoint at api/v4/postcodes. Should take form of a view living in aliss/api/v4_views.py.

Relevant docs:

Any requests should provide a q param, which are used to to filter results (istartswith is prob best for this).

Mike-Heneghan commented 5 years ago

The Postcode table has been updated to add a column with place names.

Mike-Heneghan commented 5 years ago

Basic view returning a dictionary of place_names and postcode.

Screenshot 2019-04-18 at 11 27 07
Mike-Heneghan commented 5 years ago

Filtering the data set but not with proper url format?

Screenshot 2019-04-18 at 13 02 45
Mike-Heneghan commented 5 years ago

Updated the API view for post-code locations to take a query q and filter results which start with that.

Screenshot 2019-04-18 at 14 15 32
Mike-Heneghan commented 5 years ago

Need to now query the api for the place_name and postcode rather than using the hard coated data.

Mike-Heneghan commented 5 years ago

The api is now successfully returning the place_name and postcode data for the Easy-Autocomplete feature.

https://drive.google.com/file/d/1bNRMY_1_Z83SyuRm2TldfQSrKVIyYfLj/view?usp=sharing

Mike-Heneghan commented 5 years ago

To do list:

digitalWestie commented 5 years ago

Don't worry about API exposure for now, we can deal with it later, as team are making noises about this.

Mike-Heneghan commented 5 years ago

Don't worry about API exposure for now, we can deal with it later, as team are making noises about this.

I've also been trying to write a test although currently, I'm not getting responses as I would expect. When manually testing the locations are returned as per the google drive link above.

As this is a priority I'll send the PR and we can discuss tests and API exposure when it's convenient.

Mike-Heneghan commented 5 years ago

Merged into master.