8000 Flag for graph_models to color code relations based on on_delete. (#1604) by PauloRSF · Pull Request #1664 · django-extensions/django-extensions · GitHub
[go: up one dir, main page]

Skip to content

Flag for graph_models to color code relations based on on_delete. (#1604) #1664

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

Merged
merged 7 commits into from
Jun 11, 2022

Conversation

PauloRSF
Copy link
Contributor
@PauloRSF PauloRSF commented May 4, 2021

I implemented a new flag (--color-code-deletions) for the graph_models command. It adds custom colors for 'ForeignKey's and 'OneToOneField's edges, based on their on_delete setting. That allows a quick visual understanding of the effects of a model's deletion, as proposed on issue #1604.

This is my first contribution on this project, so, if anything can/should be improved, let me know!

Closes #1604.

@JackAtOmenApps
Copy link
Contributor

Looks like a good addition. And you provided tests, so I suspect this will be an easy commit once the maintainers get a chance to take a look!

@camilonova camilonova merged commit 5053457 into django-extensions:main Jun 11, 2022
@PauloRSF PauloRSF deleted the deletions-color-coding branch December 20, 2022 13:37
@mscheper
Copy link

Thanks! I think it's pretty easy to work out, but are the meanings of the colours documented anywhere?

@PauloRSF
Copy link
Contributor Author

@mscheper It's not explicitly documented anywhere 🧐 It would be good to have it in the rst doc, though

@mscheper
Copy link

@mscheper It's not explicitly documented anywhere 🧐 It would be good to have it in the rst doc, though

Yeah, I ended up working it out and putting it in my project's docs. Thanks.

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.

[feature request] Optional colorization for graph edges based on on_delete criteria
4 participants
0