class StudentsTeacher(admin.TabularInline):
form = StudentsTeacher
model = StudentsTeacher
class Teacher_Admin(admin.ModelAdmin):
inlines = (StudentsTeacher,)
I want add a queryset in StudentsTeacher select with a filter, but it doesn't work, inlines always dispay all.
With the
get_queryset()
method you can override the querysetYou can read more about it in the django docs