I\'ve been trying to solve this problem for a couple of days now, getting quite desperate. See the commented out code snippets for some of the things I\'ve tried but didn\'t wor
Category.objects.filter(user=request.user)
returns a list object for the initial value in your form which makes little sense.
Try instead
Category.objects.get(user=request.user)
or
Category.objects.filter(user=request.user)[0]
You don't need any kind of custom forms. You can change the queryset of category
field as:
IngrFormSet = modelformset_factory(Ingredient, extra=1, fields=('name', 'category'))
IngrFormSet.form.base_fields['category'].queryset = Category.objects.filter(user__id=request.user.id)