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 #393 from pteromys/stable-jul12-bugfixes

Catalog preview and class documents
Merge branch 'main' into issue406
Merge branch 'main' into issue406
Rejected classes can be removed from getTaughtSections and similar functions.

Inserted include_rejected as a boolean for various functions in order to Do This Properly, goddammit.
Rejected classes can be removed from getTaughtSections and similar functions, try 2
Merge branch 'main' into issue406
Added editing availability to admin check availability module.
Not have to scroll to the bottom of the page each time you edit a resource/classroom.
Put forms on research page at the top of the list instead of bottom.
Adding a more fine status-based control.
I'm a derp who doesn't know how to python
Minor tweak of ajax_sections GET handling
Merge pull request #604 from learning-unlimited/shulinyeMinorFixes

Various minor fixes to small things
Merge branch 'stable-jul12-bugfixes' into main

This is to catch the two commits from pull request #393 which haven't
yet made it into any other branch.

Apologies for dredging up ancient history.
Merge branch 'main' of github.com:learning-unlimited/ESP-Website into main
Make list of classes on teacherreg page update properly

We had a caching bug because the cached inclusion tag
{% render_teacher_list_row %} was accepting 2 additional arguments besides
the class, which made it impossible for cache dependencies (e.g.
depend_on_row, depend_on_cache) to flush the cache for specific classes.
The solution here is to remove the extra arguments.  I was able to restore
the functionality of the friendly_times_with_date argument within the
template tag, but the 'can_edit' isn't going to work (that's a user
dependent variable which is incompatible with this type of caching
anyway).
Prevent integer overflow on program creation form

In case anyone lazily decides to type a very large number on the form,
this avoids an unexplained server error.
Fix code formatting in lottery controller