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
Fixed #29843 -- Manage contenttypes and permissions using hooks during makemigrations #14229
Conversation
why no one notices this! |
I'm not sure how this comment could be helpful. |
Closed by mistake, wrong button, sorry 🤦 |
@felixxm I think @auvipy is really excited about this PR and wondering why nobody is paying attention to it 😄 |
Personally, I really like this idea, it's much better than using signals which is always error prone. Detailed documentation will be crucial. We also need to remember that folks will push it to the limit, so we need to think what to do about:
|
He felix no offense :D the comment also includes me :D aswell. i know you are very busy with django 4.0 and 3.2 release :D |
That is a good call out that @arthurio and I thought about. It's really powerful to be able to add hooks based on other hooks, but we don't have anything right now, so I would be OK to not allow recursion for now. I can't think of many use cases for to need CreateModel or AddField, so we can probably get away with RunSQL and RunPython
I would prefer to allow it to return multiple operations. Otherwise someone will just be creating some kind of multiple operation themselves to allow reusability
|
@arthurio Do you have time to keep working on this? |
@felixxm I think it's a good idea to pursue but unless someone is willing to pair on it with me I don't think I can get back to it in the near future. |
@arthurio np, thanks for all your efforts :+1 Feel-free to open a new PR. |
Overview
This is a different approach from #10540. It makes things a bit easier to control and more declarative as the added operation(s) will be in the migration file(s).
CC @taylor-cedar
How it would be used
Example of output: