Fix bug in django select_related and inheritance