swcarpentry/admintool — pull request #18 by sburns (2014-07-11 03:02:33+00:00)
Title: Re-org for app factory/blueprints

Reading the issues, SWC folks want this to be more than just an instructor finder. Before we progress much further, we might consider re-organizing the app. Literature explaining some of the changes I've introduced:

* Moving the application to a package from a module http://flask.pocoo.org/docs/patterns/packages/
* Blueprint-ify major areas of the site http://flask.pocoo.org/docs/blueprints/#why-blueprints

I originally started thinking about this because testing was difficult and when all is said and done, this should fix #14 but I'm not there yet. Other things that could go in this PR...

* [ ] I'd like to move to Flask-SQLAlchemy and use [multiple binds](https://pythonhosted.org/Flask-SQLAlchemy/binds.html) instead of dealing with two different sqlalchemy engines (see `models.py` & `cities.py`). The app factory clears the way for using flask extensions like this one.
* [ ] I introduced a regression in that even when the geo-finder finds a matching city, the text box remains highlighted in red, the "hey something happened" color. I can't figure out why, would like some more eyes on it.
* [ ] Introduce proper blueprint unittests. Again, easier with the app factory but it's just not in there yet.