Filter a field in a form set (Django)
How to filter a field on a form so that items created by another user are not ordered
I have a set of forms
from django import forms
from django.forms.models import inlineformset_factory
from .models import Course, Module
ModuleFormSet = inlineformset_factory(Course, Module,
fields=['title', 'section', 'description'],
extra=2,
can_delete=True)
In the form in the list of sections, sections created by another teacher appear.
How to configure sections to be allocated only to the user who creates modules?
How to write a field filter on a form?