Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29136 closed Cleanup/optimization (invalid)

CreateView documentation incomplete

Reported by: Linurandy Owned by: nobody
Component: Documentation Version: 2.0
Severity: Normal Keywords: CreateView, documentation
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In that url https://docs.djangoproject.com/es/1.10/topics/class-based-views/generic-editing/ and https://docs.djangoproject.com/es/2.0/topics/class-based-views/generic-editing/, when create the class AuthorCreate(CreateView):, don't have absolute_url, this brings as a problem confusion.

from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.urls import reverse_lazy
from myapp.models import Author

class AuthorCreate(CreateView):
    model = Author
    fields = ['name']

class AuthorUpdate(UpdateView):
    model = Author
    fields = ['name']

class AuthorDelete(DeleteView):
    model = Author
    success_url = reverse_lazy('author-list')

Change History (2)

comment:1 by Tim Graham, 6 years ago

Resolution: invalid
Status: newclosed

The Author model defined above the code block you quoted has a get_absolute_url() method. Have I misunderstood the problem?

comment:2 by Linurandy, 6 years ago

that's right, sorry.

Note: See TracTickets for help on using tickets.
Back to Top