views:

100

answers:

1

I have a Django-based site with roughly 300,000 User objects. Admin pages for objects with a ForeignKey field to User take a very long time to load as the resulting form is about 6MB in size. Of course, the resulting dropdown isn't particularly useful, either.

Are there any off-the-shelf replacements for handling this case? I've been googling for a snippet or a blog entry, but haven't found anything yet. I'd like to have a smaller download size and a more usable interface.

+4  A: 

Hi,

The ModelAdmin class offers an raw_id_fields option, which present a input field and a search button. It presents a popup dialog to select the related user object without loading all

class ArticleAdmin(admin.ModelAdmin):
    raw_id_fields = ("user",)
Eric Acevedo
That does the trick. Thanks!
David Eyk