2๐
โ
If your model has a ForeignKey
or ManyToManyField
to a model with many items, then it can it can be very slow to render select box for that field.
You can improve performance by adding these field(s) to raw_id_fields
.
In your case, since the price
list is very long, you could do:
class OrderAdmin(admin.ModelAdmin):
raw_id_fields = ['price']
...
๐คAlasdair
Source:stackexchange.com