Skip to content

Commit 06f4ed4

Browse files
committed
Add a .select_related() to the document main tab to reduce the number
of DB queries, unfortunately it seems it doesn't really help with Django 1.2.x due to a bug (Document inherits from DocumentInfo which makes things a bit more complicated) - Legacy-Id: 5313
1 parent ab6a7f8 commit 06f4ed4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ietf/doc/views_doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def render_document_top(request, doc, tab, name):
7979

8080
@decorator_from_middleware(GZipMiddleware)
8181
def document_main(request, name, rev=None):
82-
doc = get_object_or_404(Document, docalias__name=name)
82+
doc = get_object_or_404(Document.objects.select_related(), docalias__name=name)
8383

8484
# take care of possible redirections
8585
aliases = DocAlias.objects.filter(document=doc).values_list("name", flat=True)

0 commit comments

Comments
 (0)