[Fixed]-Django not saving ModelChoiceField to base

1👍

The model field is Post.user, but your form field PostForm.selectuser. Try using user in the PostForm.

class PostForm(forms.ModelForm):
    user = forms.ModelChoiceField(queryset=User.objects.all())
    ...

Leave a comment