Django 1.8.x Documentation
from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def html' def vote(request, question_id): ... # same as above We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects” DetailView behind the scenes. Similarly, the ListView generic view uses a default template called/ _list.html; we use template_name to tell ListView to use our existing "polls/index.html" 0 码力 | 2454 页 | 2.85 MB | 1 年前3Django 3.0.x Documentation
extensions Django’s default logging configuration Pagination The Paginator class Example Paginating a ListView Using Paginator in a view function Security in Django Cross site scripting (XSS) protection Cross from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def question_id): ... # same as above, no changes needed. We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects”0 码力 | 3085 页 | 2.95 MB | 1 年前3Django 4.2.x Documentation
Security implications Configuring logging Pagination The Paginator class Example Paginating a ListView Using Paginator in a view function Security in Django Cross site scripting (XSS) protection Cross from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = "polls/index.html" context_object_name = "latest_question_list" def question_id): ... # same as above, no changes needed. We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects”0 码力 | 3305 页 | 3.16 MB | 1 年前3Django 4.1.x Documentation
Security implications Configuring logging Pagination The Paginator class Example Paginating a ListView Using Paginator in a view function Security in Django Cross site scripting (XSS) protection Cross from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def question_id): ... # same as above, no changes needed. We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects”0 码力 | 3240 页 | 3.13 MB | 1 年前3Django 4.0.x Documentation
Security implications Configuring logging Pagination The Paginator class Example Paginating a ListView Using Paginator in a view function Security in Django Cross site scripting (XSS) protection Cross from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def question_id): ... # same as above, no changes needed. We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects”0 码力 | 3184 页 | 3.14 MB | 1 年前3Django 3.2.x Documentation
extensions Django’s default logging configuration Pagination The Paginator class Example Paginating a ListView Using Paginator in a view function Security in Django Cross site scripting (XSS) protection Cross from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def question_id): ... # same as above, no changes needed. We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects”0 码力 | 3121 页 | 3.08 MB | 1 年前3Django 3.1.x Documentation
extensions Django’s default logging configuration Pagination The Paginator class Example Paginating a ListView Using Paginator in a view function Security in Django Cross site scripting (XSS) protection Cross from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def question_id): ... # same as above, no changes needed. We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects”0 码力 | 3094 页 | 3.03 MB | 1 年前3Django 1.11.x Documentation
from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def question_id): ... # same as above, no changes needed. We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects” DetailView behind the scenes. Similarly, the ListView generic view uses a default template called/ _list.html; we use template_name to tell ListView to use our existing "polls/index.html" 0 码力 | 2747 页 | 2.67 MB | 1 年前3Django 1.10.x Documentation
from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def question_id): ... # same as above, no changes needed. We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects” DetailView behind the scenes. Similarly, the ListView generic view uses a default template called/ _list.html; we use template_name to tell ListView to use our existing "polls/index.html" 0 码力 | 2538 页 | 2.59 MB | 1 年前3Django 2.1.x Documentation
from django.views import generic from .models import Choice, Question class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def question_id): ... # same as above, no changes needed. We’re using two generic views here: ListView and DetailView. Respectively, those two views abstract the concepts of “display a list of objects” DetailView behind the scenes. Similarly, the ListView generic view uses a default template called/ _list.html; we use template_name to tell ListView to use our existing "polls/index.html" 0 码力 | 2790 页 | 2.71 MB | 1 年前3
共 27 条
- 1
- 2
- 3