django complains without a clear reason, so remove .select_related().only()
This commit is contained in:
parent
b0cfa4e309
commit
4e3dd875c6
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ from c3nav.mapdata.utils.models import get_submodels
|
|||
|
||||
def optimize_query(qs):
|
||||
if issubclass(qs.model, SpecificLocation):
|
||||
base_qs = LocationGroup.objects.select_related('category').only('id', 'titles', 'category')
|
||||
base_qs = LocationGroup.objects.select_related('category')
|
||||
qs = qs.prefetch_related(Prefetch('groups', queryset=base_qs))
|
||||
return qs
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue