Make class documents show up in catalog preview.

This way, teachers who try to add class documents don't get confused
when said class documents don't show up in the preview.

ClassSubject.objects.catalog is kind of magical and selects a bunch of
related data in one giant query. Our catalog-rendering code assumes
the presence of said data, so wherever we invoke it we should pass it
classes fetched via ClassSubject.objects.catalog.

We could use catalog_cached instead of catalog since correctness of
student counts (if they even appear) isn't important in the catalog
preview. However, the performance hit is tiny since few people even
look at catalog previews--and whatever comes out of render_class_core
*needs* to be correct because that will be cached and reused in the
actual catalog.

(Said observation about caching also implies that student confusion is
a relevant motivation for this fix.)
Make render_class_core depend on qsdmedia.Media.

This is in case teachers upload class documents and then immediately
check the catalog preview to see whether they show up.

Some remarks to the future:

1. This will likely require adjustment when the schema simplification
   project gets merged.

2. Using depend_on_row instead of depend_on_model implies we won't
   catch when a document moves from one class to another. However, I'd
   bet that almost never happens; and I think it's worth not having to
   regenerate the whole catalog every time a teacher uploads a file.

3. This silently fails to empty the right cache if it hits a DataTree
   node with more than one ClassSubject on it. I suspect such DataTree
   errors have enough other symptoms that we can pretend they never
   happen. Also, in a few months, remark 1 will make this irrelevant.
Merge pull request #404 from learning-unlimited/django-1.4-support

Django 1.4 support
Implements grade range exceptions in the lottery

Adds a setting to the StudentClassRegModuleInfo model --
use_grade_range_exceptions. When this is set, running the lottery
adds another special priority level, below all existing priority
levels, but before the interested level. This level ignores
student grade range when limiting students for a class.
Make a module for admins to quickly register Junction/Delve classes
Make programs less dependent on (Student|Teacher)ClassRegModule

Adds "is not None" check in references to (Student)ClassRegModuleInfo
in modules/base.py and modules/handlers/adminvitals.py, so that programs
which don't have a (Student)ClassRegModuleInfo can still load modules
and use adminvitals.
Add Formstack client library and some models/methods to interact with Formstack forms
Add a FormstackAppSettings module_ext to store metadata and settings for a Formstack application form
Add FsStudentApp object to store data related to a student's submission
Add FormstackAppModule and /studentapp handler
Improve error handling in Formstack client library
Trivial: add a docstring and some whitespace
Cache field info in FormstackAppModule
Move get_field_info and get_student_apps from FormstackAppModule to FormstackAppSettings for easier access
Add method FsStudentApp.get_responses that returns a list of (question, response) pairs for an app
Move get_student_apps back to FormstackAppModule from FormstackAppSettings
Cache submitted data for each app to decrease API calls to Formstack
Refactor FormstackAppModule.get_student_apps

.fetch_student_apps now does most of the work, .get_student_apps calls it and caches the result.
Add /listapps and /viewapp views for listing and viewing apps respectively
Additions to FsStudentApp model and associated views

- Add admin_status and admin_comment fields to FsStudentApp
- Add new columns for those fields, plus a column for username with profile link, to /viewapp
- Modify get_student_apps logic to not clobber values for admin_status and admin_comment