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

Support for proxy models #220

Closed
wants to merge 2 commits into from

Conversation

MaybeThisIsRu
Copy link
Contributor

@MaybeThisIsRu MaybeThisIsRu commented May 6, 2022

Fixes #218
Fixes #219

django-moderations creates a LEFT OUTER JOIN query but uses the content type ID for the concrete class, even on the proxy class model managers.

To play nicely, we tell the ModeratedObject model to save only the concrete class' content type ID.

I also noticed proxy class queries breaking if you register both the concrete class and the proxy class. Simply changing the order seems to work but I have no idea why.
@MaybeThisIsRu
Copy link
Contributor Author

90a71f1 doesn't quite solve what I thought it did so back to square two for now.

@MaybeThisIsRu
Copy link
Contributor Author

I have abandoned work on this. I couldn't find a way for the concrete class to return objects of all types (the default behavior in a concrete + proxy class setup on Django). Proxy classes worked fine but the concrete class was a no-go.

@DmytroLitvinov
Copy link
Collaborator

Hi @MaybeThisIsRu ,
Thanks for your work on it in public. Maybe in future developers will find those issues/mrs and will adapt it.

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

Successfully merging this pull request may close these issues.

Does not work well with proxy classes Default manager includes rejected objects
2 participants