Commit cedf0c09 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Optimize project-list query

Note that select_related() does not automatically bring
`related_name's, such as ProjectApplication.project.
Need to specify select_related('project'), which brings
`project' (but not `owner', or other related field).
parent 340f94d4
......@@ -50,7 +50,7 @@ class Command(NoArgsCommand):
def handle_noargs(self, **options):
apps = ProjectApplication.objects.select_related().all().order_by('id')
apps = ProjectApplication.objects.select_related('project').all().order_by('id')
labels = (
'Application', 'Precursor', 'Status', 'Name', 'Project', 'Status'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment