O'Reilly logo

Sams Teach Yourself Django in 24 Hours by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Using Views to Add and Update Data in the Database

<feature><title>What You’ll Learn in This Hour</title> <objective>

How to detect and handle GET and POST requests

</objective>
<objective>

How to validate data from POST requests against the model

</objective>
<objective>

How to update data in the database using forms

</objective>
<objective>

How to add new objects to the database using forms

</objective>
</feature>

In Hour 10, “Adding Forms to Views,” you learned how to create Form objects and render them as HTML. In this hour, we will extend that concept and show you how to use rendered forms to update the database.

The following sections take you through the process of displaying the Form during a GET request, retrieving the updated data ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required