Opened 8 years ago

Closed 8 years ago

#13118 closed (duplicate)

Multiple(minimum 36) queries when opening user page in django admin

Reported by: DesZodiak Owned by: nobody
Component: contrib.admin Version: 1.1
Severity: Keywords: django admin multiple queries
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


When i am trying to edit user in django admin, admin app makes a lot of queries (see below). The difference between them just in id of element.
This queries makes while ModelAdmin form renders.
Everything below i took from django-debug-toolbar.

Here is duplicate query:

SELECT "auth_permission"."id", "auth_permission"."name",
"auth_permission"."content_type_id", "auth_permission"."codename" FROM
"auth_permission" INNER JOIN "django_content_type" ON
("auth_permission"."content_type_id" = "django_content_type"."id")
ORDER BY "django_content_type"."app_label" ASC,
"auth_permission"."codename" ASC

Here is execution stack


And part from template

9{% if field.is_checkbox %}
10{{ field.field }}{{ field.label_tag }}
11{% else %}
12{{ field.label_tag }}{{ field.field }}
13{% endif %}
14{% if field.field.field.help_text %}<p class="help">{{ field.field.field.help_text|safe }}</p>{% endif %}

Change History (3)

comment:1 Changed 8 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by Matthias Kestenholz

This problem does not exist on trunk since [13683]. It still exists on 1.2 however, because #14090 has not been backported.

I'm not sure whether this qualifies as a bug. If it is an enhancement this ticket should be closed as duplicate.

comment:3 Changed 8 years ago by Matthias Kestenholz

Resolution: duplicate
Status: newclosed

Sorry for the spam, it has been backported. My bad.

Note: See TracTickets for help on using tickets.
Back to Top