Introduction to CBVs Flashcards
Code for adding class-based views to your apps urls.py file?
code for calling nothing but a template using class based views.
explain what **kwargs and *args means.
prepares a function to accept an arbitrary number of args of kwargs.
Code for injecting content into a cbv.
what model field class is for the input of positive whole numbers
PositiveIntegerField()
In a class based view, what line of code provides you with a list of all the information contained in a model?
model = models.School
line of code for assigning a template to a cbv.
template_name = ‘basic_app/school_detail.html’
how do you change the context object name in the view function?
context_object_name = ‘schools’
ListView returns …
DetailView returns …
model_name_list
model_name
An example of a line of code that relates a list of objects to a ForeignKey
path() function in urls.py that links a view to an the id of a model.
how do you reference a specific instance of a model’s cbv as a link
What does CRUD stand for?
- Create
- Retreat
- Update
- Delete
url pattern for the CreateView cbv.
for the CreateView cbv, what template name does django automatically look for?
the name of the model being created underscore form.html
model_form.html