Skip to content

Commit 529721c

Browse files
committed
Polymorphic FK should be explicitly overridden
1 parent 749ebe3 commit 529721c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

example/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ def get_queryset(self, *args, **kwargs):
203203
class CompanyViewset(ModelViewSet):
204204
queryset = Company.objects.all()
205205
serializer_class = CompanySerializer
206+
prefetch_for_includes = {
207+
'current_project': ['current_project'],
208+
}
206209

207210

208211
class ProjectViewset(ModelViewSet):

0 commit comments

Comments
 (0)