InlineModelAdmin.raw_id_fields
By default, Django’s admin uses a select-box interface (<select>) for fields that are ForeignKey
. Sometimes you don’t want to incur the overhead of having to select all the related instances to display in the drop-down.
raw_id_fields
is a list of fields you would like to change into an Input
widget for either a ForeignKey
or ManyToManyField
:
1 2 3 | class BookInline(admin.TabularInline): model = Book raw_id_fields = ( "pages" ,) |
Please login to continue.