Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect inheritance in associated Lesson, UpdateView #6

Open
garthmortensen opened this issue Nov 26, 2023 · 0 comments
Open

Incorrect inheritance in associated Lesson, UpdateView #6

garthmortensen opened this issue Nov 26, 2023 · 0 comments

Comments

@garthmortensen
Copy link

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 . import models
from django.views import generic

class DogUpdateView(generic.CreateView):
    model = models.Dog
    template_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 . import models
from django.views import generic

class DogUpdateView(generic.UpdateView):
    model = models.Dog
    template_name = 'dog_form.html'
    fields = ['name', 'description', 'shelter']

Thanks!

@garthmortensen garthmortensen changed the title Mistake in associated Lesson, UpdateView Incorrect inheritance in associated Lesson, UpdateView Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant