August 2016
Beginner to intermediate
717 pages
15h 24m
English
ModelForms are Django forms based on models. The fields of these forms are automatically generated from the model that we have defined. Indeed, developers are often required to create forms with fields that correspond to those in the database to a non-MVC website.
These particular forms have a save() method that will save the form data in a new record.
To broach, we will take, for example, the addition of a supervisor. For this, we will create a new page. For this, we will create the following URL:
url(r'^create-supervisor$', 'TasksManager.views.create_supervisor.page', name="create_supervisor"),
Our view will contain the following code:
from django.shortcuts import render from TasksManager.models ...
Read now
Unlock full access