#397: temporary workaround for load_on_pending behavior I didn't realize

I'll explain this at greater length when I do the later pull request with the more general fix.  The short version is that there's a SQLAlchemy setting called ``load_on_pending`` which I didn't read the documentation for carefully enough, so I thought it would auto-load foreign keys, but it turns out it only does that in some situations.  So I'll make a change in ``models.py`` and write some unit tests to ensure this always works in the future as part of a separate pull request.