Home > Article > Backend Development > Django implements universal views through classes
This week is my first week of employment. On the first day of employment, I saw the project code of the Jiaxing boss. There are class methods in views and I'm confused.
Reminiscent of the previous phone interview at Beijing Rong 360, which asked me if I had ever written a class method... It seems that it is necessary to understand the class method of the view. I searched a lot on the Internet, and it turned out that this It is the so-called "universal view".
I go to work every week, and I only work for 5 days this week; so I go to bed very late in the morning. I don’t seem to have much time to write a detailed blog on this aspect, but I will do so when I have time. You can take a look at the reference article below, I think it is also well written.
You can look at my git code. If you have some basic knowledge of Django, such as the basic def view, I believe you can understand it. I also wrote a lot of comments.
GIT URL:
Reference article:
The above is the detailed content of Django implements universal views through classes. For more information, please follow other related articles on the PHP Chinese website!