-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use object instance when getting _meta info in admin #331
base: master
Are you sure you want to change the base?
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? |
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