How does Django get the kwargs of an parent class?
In the case of the model field class, it shows the kwargs of the inherited model even though I set it to __init__(self, *args, **kwargs)
.
I don’t know how this is done.
How do I retrieve and display the kwargs of the parent class?
Not sure what you are trying to do but parent classes don’t keep kwargs unless kwargs is an explicit instance property.
kwargs is usually just a mapping to propagate values during initialization. After initialization, it is gone. Therefore, you are more likely to set the kwargs of a parent class but less likely to retrieve it.
I’m not sure I’m following what exactly you’re trying to identify here, but in general terms, the python inspect
module is what you would use to identify internal information about calling sequences.
Additionally, the __dict__
object on a class also provides a wealth of information.
Side Note: That display you’re showing is not created by Django, Django is not doing that, that’s created by your IDE.
As you said, it seems to be a feature supported by vscode.