Extreme Thinking
django.views

2020-08-19


In the class django.views.generic.list.ListView, which of the following methods is called earliest in the process?
--> get_template_names()
generic.list.ListView -> earliest ->  get_template_names
In the class django.views.generic.list.ListView, which of the following methods is called latest in the process?
--> render_to_response()
views ->  latest -> render_to_response
In the class django.views.generic.detail.DetailView, which of the following methods is called earliest in the process?
--> dispatch()
generic.detail.DetailView -> earliest -> dispatch
In the class django.views.generic.detail.DetailView, which of the following methods is called latest in the process?
--> render_to_response()
views ->  latest -> render_to_response
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/abc/dog_detail.html
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_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.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?
--> dog_list
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
For the following line in a views.py file -> class ArticleListView(ListView): 
what is the best description of "ArticleListView"?
--> The class that is being created
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 the Django source (not py file)