use flask-sqlalchemy's query_class to override query object
Merge pull request #12 from miguelgrinberg/master

play nice with Flask-SqlAlchemy's query object