get_submodels(SpecificLocation)
This commit is contained in:
parent
c4b3932e9b
commit
15831b97ef
1 changed files with 1 additions and 3 deletions
|
@ -165,9 +165,7 @@ class LocationViewSet(RetrieveModelMixin, GenericViewSet):
|
|||
queryset = queryset.filter(reduce(operator.or_, conditions))
|
||||
|
||||
if detailed:
|
||||
for model in get_submodels(Location):
|
||||
if model == LocationGroup:
|
||||
continue
|
||||
for model in get_submodels(SpecificLocation):
|
||||
queryset = queryset.prefetch_related(Prefetch(model._meta.default_related_name+'__groups',
|
||||
queryset=LocationGroup.objects.only('id', 'titles')))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue