[Fixed]-Django admin inline queryset limit

16👍

Try this:

from django.forms.models import BaseInlineFormSet

class TicketNoteFormSet(BaseInlineFormSet): 
    def get_queryset(self) :
        qs = super(TicketNoteFormSet, self).get_queryset()
        return qs[:5000]

class TicketNoteAdmin(models.TabularInline):
    model = models.TicketNote
    formset = TicketNoteFormSet

Leave a comment