Convert an isinstance() back to a type()

This reverts one line of 673e5dd.  Previously it was checking if the type() of
something was QuerySet (and erroring if so).  The change caused it to error on
*any* instance of QuerySet, including for example a ValuesListQuerySet.
Merge pull request #1451 from learning-unlimited/fix-isinstance

Convert an isinstance() back to a type()