Welcome back, everyone, to this section of the course on class-based views.
So far, we've actually only seen functions inside our reviews that profile.
But just like forms and models, Django provides an entire view class system that is very powerful for
quickly rendering commonly used views.
Let's go ahead and see Django developers own reasoning from the documentation on why to use class-based
views.
So from the documentation, Django developers say the following writing Web applications can be monotonous
because we repeat certain patterns again and again, Django tries to take away some of that monotony
at the model and template layers.
But web developers also experience this boredom at the view level.
And let's take a moment to think about that.
Are there going to be function based views that you use over and over again?
Well, certainly if you have a model, you're probably going to have views like creating a new instance
in that model or listing all the instances of that model or deleting or updating based on the view side
of things.
Those are going to be commonly used tasks.
So in that case, Django has views that in a class based form can automatically create those connections
for you.
So jingles, generic views were developed to ease that pain.
They take certain common idioms and patterns found in viewed development and obstruct them so that you
can quickly write common views of data without having to write too much code.
That's really where the class based views strength comes from.
These generic views that you can easily use to just in a few lines of code, connect a model to a template.
So again, Django CPB's or class based views come with many pre-built generic class views for common
tasks, such as listing all the values for a particular model in a database.
This, in particular, is known as the list of you.
Or maybe you want to create a new instance of a model object that's known as a create view.
So once we cover the basics of class based views, we're going to go through a quote unquote tour of
the key generic class based views and cover the few specifics that are important to know when using
them as a quick note.
They should be relatively easy to use to understand on their own.
So towards the end of this section, to be fully honest, it's going to feel maybe slightly repetitive
because the class space views are really easy to use.
Once you understand how they work.
So the very last few lectures, we're going to go quite quickly through those views because they pretty
much explain themselves.
So we're going to do here is we're going to talk about the very basics of class space views and then
we're going to go give you a tour of generic views, starting with a template view.
That is, just how do I connect a template to a view, to a URL?
Then we'll talk about list of views, detailed views, great views and elite views, as well as a few
other ones like update views and form views.
OK, let's get started.
I'll see you at the next lecture.