[Answer]-Unable to store value in the model instance that has retrieved from model form

1👍

you should try:

if request.method == 'POST':
    form = ContactForm(request.POST)
    mInstance = form.save(commit=False)
    mInstance.trackerID = 23232;
    mInstance.save()

Note the commit=False parameter.

More info:
https://docs.djangoproject.com/en/1.6/topics/forms/modelforms/#the-save-method

👤pahko

Leave a comment