[PYTHON] django class-based views API class diagram

Regarding class-based views

django's view has a simple function-based description method and a class-based description method. According to django's documentation, there were only function-based conventions at first, but as VIEW development experience accumulated, it was recognized that there were patterns and common idioms, and it became abstracted.

Developers can use those results as a "generic view". The English word generic means "general purpose" in Japanese. It's possible to use the sample just by glancing at the document, but honestly it was hard to understand how it works. When I looked it up, thinking it was annoying, it was surprisingly neat and compact, so it didn't take long. It did not have a "general purpose" structure for Date. When I'm writing a class-base view and I'm wondering where and what logic to put in, I feel like I've come to feel atari by looking at this class diagram.

The class diagram in the image below exports the class associations that fit under django.views.generic. Some fields and methods are not written in a broken manner.

django_class_base_view_api.png

I could easily find out the class dependencies using PyCharm's features. I was able to open the corresponding file and display only the class on the left side with Alt-7 as shown below. (The cord can be folded separately.) pycharm.PNG

I used Enterprise Architect to create the class diagram.

Recommended Posts

django class-based views API class diagram
Django class-based view
Overview of class-based generic views and inherited class relationships
Getting started and using sample class-based generic views in Django
Create an API with Django
Qiita API Oauth with Django