You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo's associated MS Learn lesson titled Use generic views to edit data contains an error. In section UpdateView, the code snippet currently appears as:
from . importmodelsfromdjango.viewsimportgenericclassDogUpdateView(generic.CreateView):
model=models.Dogtemplate_name='dog_form.html'fields= ['name', 'description', 'shelter']
However, the class should not inherit generic.CreateView.
Rather, it should inherit generic.UpdateView, as follows:
from . importmodelsfromdjango.viewsimportgenericclassDogUpdateView(generic.UpdateView):
model=models.Dogtemplate_name='dog_form.html'fields= ['name', 'description', 'shelter']
Thanks!
The text was updated successfully, but these errors were encountered:
garthmortensen
changed the title
Mistake in associated Lesson, UpdateView
Incorrect inheritance in associated Lesson, UpdateView
Nov 27, 2023
This repo's associated MS Learn lesson titled Use generic views to edit data contains an error. In section UpdateView, the code snippet currently appears as:
However, the class should not inherit
generic.CreateView
.Rather, it should inherit
generic.UpdateView
, as follows:Thanks!
The text was updated successfully, but these errors were encountered: