Quicklook SQL performance tweaks

Reduced number of queries needed for rendering the quicklook page due to the use of select_related which pre-caches related models.