add clarifying comment about passing a single page type

This commit is contained in:
Matt Westcott 2019-11-28 11:51:00 +00:00
parent 1d8f85c1c5
commit dd664218b1

View file

@ -437,6 +437,8 @@ class PagesAPIViewSet(BaseAPIViewSet):
return self.get_base_queryset()
elif len(models) == 1:
# If a single page type has been specified, swap out the Page-based queryset for one based on
# the specific page model so that we can filter on any custom APIFields defined on that model
return models[0].objects.filter(id__in=self.get_base_queryset().values_list('id', flat=True))
else: # len(models) > 1