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

Implement related views #23

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Natureshadow
Copy link
Contributor

This implements a related_views attribute similar to related_urls. It takes a list of views instead of URL names or paths, so that views that take non-optional arguments can be matched without hard-coding URL snippets.

It is also guaranteed to work all the time and match unambiguously, because it matches in the reverse direction of related_urls — it looks at the current request, which yielded a view, and compares that very view to the list.

I consider this far more useful than the related_urls approach because the latter more or less enforces anti-patterns, but of course I do not mind having related_urls as well.

@Natureshadow
Copy link
Contributor Author

I believe the testsuite breakage is unrelated to my changes.

@Natureshadow
Copy link
Contributor Author

@MiltonLn Any views on this :)?

@MiltonLn
Copy link
Member

Hey @Natureshadow thanks for the contribution, I'm gonna take a closer look this weekend.

@Natureshadow
Copy link
Contributor Author

Hey @Natureshadow thanks for the contribution, I'm gonna take a closer look this weekend.

Did you come to a conclusion yet :)?

@Natureshadow
Copy link
Contributor Author

Hi! I hope you had peaceful holidays.

Did you get a chance to look into this?

@yamijuan
Copy link
Member

Hi @Natureshadow can you update your PRs with the current master version? That should fix all the builds

@Natureshadow
Copy link
Contributor Author

Hi @Natureshadow can you update your PRs with the current master version? That should fix all the builds

Done!

@Natureshadow
Copy link
Contributor Author

Hi,

this is to inform you that I will fork and release as django-menu-generator-ng next week, if there is no action on this PR.

Cheers,
Nik

Spawin added a commit to Spawin/django-menu-generator that referenced this pull request Jul 13, 2024
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.

3 participants