-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: master
Are you sure you want to change the base?
Implement related views #23
Conversation
I believe the testsuite breakage is unrelated to my changes. |
@MiltonLn Any views on this :)? |
Hey @Natureshadow thanks for the contribution, I'm gonna take a closer look this weekend. |
Did you come to a conclusion yet :)? |
Hi! I hope you had peaceful holidays. Did you get a chance to look into this? |
Hi @Natureshadow can you update your PRs with the current |
Move catch-all URL pattern to bottom; it was actually shadowing all other patterns.
11e0d34
to
84c80f3
Compare
Done! |
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, |
This implements a
related_views
attribute similar torelated_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 havingrelated_urls
as well.