With
GenericForeignKey functionality, it is possible to refer to arbitrary model. Let's ay we have
Like model, which is naturally may refer to many types of data (blogposts, users, photos, comments, etc). And so it is desireable to be able to perform such lookups:
Like.objects.prefetch_related('content_object__followers', 'content_object__people_on_photo')
where
followers is the field of
User model and
people_on_photo the field of
Photo model.
Currently
.prefetch_related will raise an error like
Cannot find field `followers` on Photo object.
because currently it is assumed that lookups are 'strict', and data for each lookup is homogenous (stealed the word form comment in sources :).
So I think it would be nice to implement feature for non-strict lookups in addition to
#17001.