Quiz 12 (wk4)
For the following line in a urls.py file urlpatterns = [ path('', TemplateView.as_view(template_name='gview/main.html')), ... Where would you find the actual code for TemplateView? In settings.py In views.py In urls.py Somewhere in the Django source
Somewhere in the Django source
For the following line in a views.py file class ArticleListView(ListView): what is the best description of "ArticleListView"? The class that is being extended The name of a view function The first parameter to the render() method The class that is being created
The class that is being created
For the following line in a views.py file class ArticleListView(ListView): what is the best description of "ListView"? The class that is being extended The first parameter to the render() method The name of a view function The class that is being created
The class that is being extended
By convention when using an app_name of "abc" and a model of "Dog", if you use a View that extends django.views.generic.list.ListView, what is the name of the context variable that will include all the Dog objects in the template when it is being rendered? dogs_select dogs dog_list dogs.values()
dog_list
In the class django.views.generic.detail.DetailView, which of the following methods is called earliest in the process? get_queryset() get_object() dispatch() render_to_response()
get_queryset()
In the class django.views.generic.list.ListView, which of the following methods is called earliest in the process? get_template_names() get_queryset() render_to_response() get_context_data()
get_queryset()
In the class django.views.generic.detail.DetailView, which of the following methods is called latest in the process? get_object() get_queryset() dispatch() render_to_response()
render_to_response()
In the class django.views.generic.list.ListView, which of the following methods is called latest in the process? get_template_names() get_context_data() get_queryset() render_to_response()
render_to_response()
If you want to override the template name chosen by convention in a View that extends django.views.generic.detail.DetailView what is the name of the class attribute variable that you use? template template_name template_override template_extend
template_name
By convention when using an app_name of "abc" and a model of "Dog", if you use a View that extends django.views.generic.detail.DetailView, what is the file name that will be used for the template? templates/dog_detail.djtl templates/doc/abc_detail.djtl templates/abc/dog_detail.html templates/abc/dog_detail.djtl
templates/abc/dog_detail.html