Added support for encoding ``Model`` and ``QuerySet`` objects