Form Validation success can be directly saved
Case exercises
Problems
When performing form validation code is to be entered twice
Paul is saved to the database is stored only once
What should I do?
The original model
Which can be added to the model-based validation rules if necessary
Defined form model class
Ruled out password
Two custom form model class field
Verify that both passwords are the same in the form model class
Method override the parent class clean
View Data Processing
数据行对象 = 对象.save(commit=False)
Without commit the False
Form over the data will be stored directly to the table
Since the model form classes omit the password
So even in this 数据行对象
which adds to the value of the password
Can be saved by a save method after bin