itsahsiao / breadcrumbs

A full-stack Flask web app that lets foodies search restaurants, track their eating history, while also connecting with friends
28 stars 10 forks source link

Limitation: Validation of city not within database #17

Open itsahsiao opened 8 years ago

itsahsiao commented 8 years ago

Currently, I am loading restaurants for a city into my database by making Yelp API requests. I could load more than one city's worth of restaurants into my initial dataset, i.e. "Sunnyvale" and "San Francisco", so that restaurants from these two cities would be stored in my database.

For my app, what if I get a user that does not belong to either city?

During the signup, when I come across a user like this, I would like to add the city added to my database and make a Yelp API request to grab and load all restaurants for this particular city into my database.

What if the user spells the city wrong? This would not affect the API call, as Yelp is smart enough to figure out which city you are referring to and still return results, but this could affect typos in my database. And I do not want to have a list of all cities that they can choose from...

Possibilities:

This is also related to Issue #10 if I wanted unique record for city, state, country... But still need the user input for this somehow to populate these fields.