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

Make subclassing reusable #5324

Closed
wants to merge 1 commit into from

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Feb 20, 2019

I'm extracting the code from Integrations to make it reusable for #5323. I'll move this to another file, but I'd like to see if we want to follow this path first.

Also, tests are passing for subclassing

https://github.com/rtfd/readthedocs.org/blob/3218c808e87206983c4eb3ce4faceddbcc0f7aa3/readthedocs/rtd_tests/tests/test_integrations.py#L169-L169

@stsewd stsewd added the PR: work in progress Pull request is not ready for full review label Feb 20, 2019
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good refactor. I wonder if we should be using an existing solution for this instead?

https://django-polymorphic.readthedocs.io/en/stable/
https://django-model-utils.readthedocs.io/en/latest/managers.html#inheritancemanager

both look like good options.

@stsewd
Copy link
Member Author

stsewd commented Feb 26, 2019

Ok, not sure how to block the review here, but this is still a work in progress p:

Need to move this code to another place.

@stsewd
Copy link
Member Author

stsewd commented Feb 26, 2019

Love it https://django-polymorphic.readthedocs.io/en/stable/, it's what we need. Maybe we can use it only for the new models (#5323) and create a separete issue/pr to adapt current models? Here is the migration guide https://django-polymorphic.readthedocs.io/en/stable/migrating.html

If so, we can close this PR and I can update the other PR to use that package

@humitos
Copy link
Member

humitos commented Mar 4, 2019

Maybe we can use it only for the new models (#5323) and create a separete issue/pr to adapt current models? Here is the migration guide django-polymorphic.readthedocs.io/en/stable/migrating.html

This makes sense to me.

@stsewd
Copy link
Member Author

stsewd commented Mar 4, 2019

I opened #5394 to track this

@stsewd stsewd closed this Mar 4, 2019
@stsewd stsewd deleted the make-subclassing-reusable branch March 4, 2019 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: work in progress Pull request is not ready for full review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants