Hi there, I think that I have found a bug with the rendering of list_editable objects in the change list. The problem that I am running into is that if I include a field that is a foreign key in list_editable, the change_list hits the database every time that it renders the foreign key's widget. This means that it hits the database O(m*n) times where m is the number of editable foreign keys in the admin model and n is the number of rows being rendered in the change_list.
For example, say that we have the following models: class Host(models.Model): name = models.CharField(max_length=128, unique=True) class Account(models.Model): host = models.ForeignKey(Host, related_name="accounts") name = models.CharField(max_length=128) ...and the following admin model: class AccountAdmin(admin.ModelAdmin): list_display = ('name', 'host') list_editable = ('host',) Then if we load up a bunch of data (one host, 40 accounts) and go to the change_list (/admin/accounts/account), we will find that the database is hit (m*n)+3 = 43 times. The queries that it executes are as follows: EXECUTIONS | TIME | QUERY 40 | 384 ms | SELECT "hosts_host"."id", "hosts_host"."name" FROM "hosts_host" 1 | 17 ms | SELECT "auth_message"."id", "auth_message"."user_id", "auth_message"."message" FROM "auth_message" WHERE "auth_message"."user_id" = %s 1 | 0 ms | SELECT COUNT(*) FROM "accounts_account" 1 | 0 ms | SELECT "accounts_account"."id", "accounts_account"."host_id", "accounts_account"."name", "hosts_host"."id", "hosts_host"."name" FROM "accounts_account" INNER JOIN "hosts_host" ON ("accounts_account"."host_id" = "hosts_host"."id") ORDER BY "accounts_account"."id" DESC As you can see, the vast majority of the hits (40/43) were for the exact same query and served only to get a list of all of the hosts. I think that this occurs when the foreignkey Select widget's options are rendered at django/forms/widgets.py:~411. I realize that I am probably doing something wrong, so any advice about the correct way of doing this would be appreciated. If this is a legitimate bug, is there anything that I can do to avoid it but still get the same functionality? Thanks! PS: Please let me know if you need any more information (screen shots, etc). -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.