Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API improvements for filter project and declarative raw syntax #438

Merged
merged 5 commits into from
Jul 31, 2017

Conversation

NealHumphrey
Copy link
Collaborator

Several updates to the server to get our recent api refactor useable, plus endpoint adjustments that are needed by our map view.

  • Joins the filter endpoint to the zone_facts table so that all the zone_facts data is available for filtering
  • Same thing for the '/api/project' endpoint, which returns the whole project table plus the denormalized data from the zone_facts table joined to each project
  • Renames declarative endpoints to /api/raw/<tablename> and removes the existing raw endpoint that provided duplicative data.
  • Alters the pagination defaults of the /api/raw endpoints - can get up to 10,000 rows max, and use the results_per_page query parameter to get a specific number (default is 100). This means that when using this for the 'projects' endpoint, we will need to ask for a higher default (we currently have 500+ projects, but should set this at a very high number so we don't accidentally miss any as our dataset grows).
  • Fixes the database_choice issue from the move to declarative app so that we can deploy to the server.
  • Renames the "items" keyword in all existing endpoints to be the keyword "objects". This makes our old endpoints consistent with the default behavior of flask-restless declarative section. Need to update front end code to expect this new format

This version of the code has been deployed to the Code for DC server. The Code for DC RDS database has also been updated with the most recent copy of dev load_data.py, which means that it has the calculated_zone facts table so that the api adjustments in this code works correctly. You can see it here:

http://housinginsights.us-east-1.elasticbeanstalk.com/api/project/
http://housinginsights.us-east-1.elasticbeanstalk.com/api/project/NL000055
http://housinginsights.us-east-1.elasticbeanstalk.com/api/filter
http://housinginsights.us-east-1.elasticbeanstalk.com/api/raw/project?results_per_page=5

Next up I will be fixing front end code to match.

…name>' to avoid clashes with previously written custom endpoints and to mimic the current raw endpoint that it is replacing

- Renames all instances of 'items' in existing endpoints to be 'objects' to match the behavior provided by the Restless app to allow for consistent front end use.
…ne types.

Removes outdated raw endpoint in favor of the newer declarative format (which provides pagination, filtering etc.)
… table, either for all projects or for a specific nlihc_id

- add name and address to the filter endpoint

Deploying this version to the codefordc server to test integration w/ live site
…nstalk server and w/ varying database choices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant