Skip to content
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

Question : Why not a Mixin? #8

Open
madEng84 opened this issue Mar 29, 2018 · 3 comments
Open

Question : Why not a Mixin? #8

madEng84 opened this issue Mar 29, 2018 · 3 comments

Comments

@madEng84
Copy link

Only one question.

Why didn't you create a Mixin instead of a new ModelAdmin ?

Thanks

@PetrDlouhy
Copy link
Owner

The original snippet (https://djangosnippets.org/snippets/2887/) was written this way. I don't remember any reason, why this couldn't be Mixin, but I don't know if there is no obstacle either.
You are free to rewrite this to be Mixin (and include the mixup for backward compatibility) and make PR.

@madEng84
Copy link
Author

I hope it!

Thank you for your immediate answer

@PetrDlouhy
Copy link
Owner

I tried to do this, but I am not sure if it is possible with metaclasses.
Anyway, I use the RelatedFieldAdmin class on some places together with other base classes derived from ModelAdmin and it works, so I am not sure, if the current representation have any restriction from being used as Mixin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants