Correctly import QuerySet.
Correctly determine model name on Django < 1.6.