Opened 9 years ago
Last modified 9 years ago
#28057 closed Bug
Admin inlines very slow to render — at Initial Version
| Reported by: | Marc DEBUREAUX | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | 1.11 |
| Severity: | Normal | Keywords: | admin inlines |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When using inlines in Django admin, it renders very poorly even when creating a new element (so no data to load, database time always the same).
And the higher the number in "extra" parameter, the longer it takes to load the form.
class EffectModifierInline(admin.TabularInline):
model = EffectModifier
extra = 1
@admin.register(Effect)
class EffectAdmin(admin.ModelAdmin):
fieldsets = (
# Whatever
)
inlines = [EffectModifierInline]
# TODO:
list_display = ()
list_editable = ()
list_filter = ()
def get_queryset(self, request):
return super().get_queryset(request).prefetch_related('modifiers')
Note:
See TracTickets
for help on using tickets.


