Django 1.6 support

There's some ugly code for ProxyGenericForeignKey.