How it works...

Django model forms are forms that are created from models. They provide all of the fields from the model so you don't need to define them manually. In the preceding example, we created a model form for the InspirationalQuote model. When we save the form, the form knows how to save each field in the database, as well as to upload the files and save them in the media directory. After save, the view returns the user to a listing of all quotes, the view for which is not discussed here.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.14.63