[Answered ]-Django admin: view hangs on field_sets block

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

Leave a comment