Fix Django 1.5 proxy models

Hi,
These commits fix the last issue with Django 1.5 support; by restoring polymorphic features when there are proxy models involved.

I've got some more commits ready, but they all build on top of this one.