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

Polymorphic relationships within sharded databases (contenttypes framework) #92

Open
Syntaf opened this issue Jul 28, 2021 · 3 comments

Comments

@Syntaf
Copy link

Syntaf commented Jul 28, 2021

Hey all 👋

Has anyone managed to get Polymorphic relationships functional on sharded databases? When trying to do so myself, I found that I was unable to define such relationships because the contenttypes framework only persists information on the default database.

I imagine a solution would involve persisting the contenttypes tables across every shard, but haven't had much luck so far accomplishing this myself.

Any tips or recommendations would be awesome, thanks!

@JBKahn
Copy link
Owner

JBKahn commented Aug 17, 2021

Sorry, I haven't been working on this repo much since I haven't used much in the way of Django/Python for work over the past year since switching jobs.

My next goal was going to be working on adding some basic functionality for multi-db support directly in Django for stuff like that. I think it's possible to monkey-patch but you'd need to override that in a few places to get it to work like that.

@JBKahn
Copy link
Owner

JBKahn commented Aug 17, 2021

It may be easier to fix this in Django than to try to hack it.

@Syntaf
Copy link
Author

Syntaf commented Aug 17, 2021

Thanks for the reply @JBKahn - I agree that a solution would probably fall into Django rather than this library since the issue stems from the contenttypes framework.

Did you have the same solution in mind that I mentioned above? Just looking to pick your brain but no worries if you're too busy doing other things 👍 - this is something that would be great to support with sharding and I'm interested in looking into it further.

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