Sun 20 June 2010
In one of the apps I'm developing at work, I wanted to make it easy for
our content admins to create a new row in the Django Admin. Most of the
time, they need to create a new row that is associated to their own user
account. It would save them a couple of steps if the user field is set
to a default value. Thanks to my coworker, Dave
Ziegler, for helping me figure
use raw_id_fields in Django Admin. This is especially useful when
you have plenty of users. What you'll see is the id of the user in the
text field with a link to look up users next to it (instead of a
dropdown containing usernames of all the users).
If you don't set the raw_id_fields, it would take a long time for
Django Admin to load the 'Change ' page since all the users in your
database needs to be loaded.