Home > Software design >  Django: as_view: How does cls and initkwargs are passed to view function
Django: as_view: How does cls and initkwargs are passed to view function

Time:11-09

I am trying to understand the as_view code for Class based views. I see

self = cls(**initkwargs)

How the view function get cls and initkwargs

I have put an image to mean what I want to ask

enter image description here

CodePudding user response:

It does not. Both cls and initkwargs come from as_view's arguments. The attribute assignments that happen to the view function are meant for later processing.

  • Related