I had a similar problem recently, this is from the views.py file
def CircleAdd(request): form = CircleAddForm(request.POST) if form.is_valid(): Circle = form.save(commit=False) Circle.Author = request.user Circle = Circle.save()
And then I had a form for the circles model, which really was a shell (forms.py)
class CircleAddForm(ModelForm): class Meta: model = Circle
Remember to import the form in your submission!
Edit: not even sure if you even need to worry about a separate form, the key bit is a fake commit, followed by the real one
hcliff
source share