9.3 Webpages for Updating Objects

The behavior in a view that updates an object is very similar to that of a view that creates an object. In fact, the only difference is that the instance of the model class must already exist and be saved in the database.

The implication is that we will need to identify this object. While the URL patterns for views that created objects were not important, we now have to focus on the URL patterns, as this is how the user will identify the data. In many ways, views for updating objects are a combination of detail views and object creation views.

The state machine for view is only subtly modified, as listed in Table 9.10.

Table 9.10: View States for Updating Objects

In Chapter 7, Section 7.3.9, we saw that ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.