Reputation: 1086
In a one-to-many relationship, how can I override the drop-down menu in the change-form to be able to select value from popup window, specially when dropdown could hold a pretty long list which may slowdown the page load.
Upvotes: 1
Views: 1175
Reputation: 1086
Just found the answer:
raw_id_fields is a list of fields you would like to change into an Input widget for either a ForeignKey or ManyToManyField:
class ArticleAdmin(admin.ModelAdmin): raw_id_fields = ("newspaper",)
The question now is how can I display a user friendly value instead of the Id returned from the popup.
Upvotes: 1