mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #22007 -- Fixed cbv docs - make imports consistent
Thanks to trac user kinjal.dixit for the report.
This commit is contained in:
parent
926e18d7d1
commit
d399731bf2
2 changed files with 11 additions and 3 deletions
|
@ -71,7 +71,7 @@ something like::
|
|||
In a class-based view, this would become::
|
||||
|
||||
from django.http import HttpResponse
|
||||
from django.views.generic.base import View
|
||||
from django.views.generic import View
|
||||
|
||||
class MyView(View):
|
||||
def get(self, request):
|
||||
|
@ -113,7 +113,7 @@ and methods in the subclass. So that if your parent class had an attribute
|
|||
``greeting`` like this::
|
||||
|
||||
from django.http import HttpResponse
|
||||
from django.views.generic.base import View
|
||||
from django.views.generic import View
|
||||
|
||||
class GreetingView(View):
|
||||
greeting = "Good Day"
|
||||
|
@ -198,7 +198,7 @@ A similar class-based view might look like::
|
|||
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import render
|
||||
from django.views.generic.base import View
|
||||
from django.views.generic import View
|
||||
|
||||
from .forms import MyForm
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue