Use object instance when getting _meta info in admin#331
Use object instance when getting _meta info in admin#331frennkie wants to merge 1 commit intojazzband:masterfrom
Conversation
|
Changed to Draft as tests are failing (worked on my machine).. will look into it. |
Make sure to use the object instance in admin.py in order to get the correct app_label and model_name. This is important when a subclass (e.g. of Newsletter) is used.
2c02562 to
6a25089
Compare
|
The tests prevented me from making a mistake. I don't think this can be "fixed". But other line is being fixed in this PR. Makes it easer to subclass. |
Why can't it be fixed? It seems obj is a class instance (just from looking at it), so it does seem it would have the same behaviour. Could you verify this, for completeness sake? Thanks! Great contribs! Forgot how much fun Open Source was. 🙌 |
Yes, Update: I think I found it.. the |
|
Right. Thanks for the feedback. Are the API's used here documented API's? If not, they might be eligible to change and thus they might add additional maintenance load. In such case, perhaps it's wise to keep this work alive in a branch or a fork, until a stable API allows us to implement this well. I feel that subclassing the What are your thoughts about this? |
716b4d8 to
e48481c
Compare
87e32e0 to
7071815
Compare
Make sure to use the object instance in admin.py in order to get the correct app_label and model_name. This is important when a subclass (e.g. of Newsletter) is used.
fix #330