Without using django forms how to validate and save form data

Viewed 788

Suppose I have a 'question' model with two fields - title and content

Now think of question creation form. Using django forms I can display it to template and validate using is_valid method.

But I don't want to use django inbuilt forms. I want to write my forms in handwritten html and send it to server using POST method.

How will validation and saving to database will work in this case?

I am doing something similar to this guy but I am not satisfied with the existing answers

1 Answers

In your views:

import Model
Param = request.post.get('param') 
Model.objects.create(field=param)

Just like that, you have saved that to the model.

Related