Skip to content

Implement related views #23

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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 :)?

@yamijuan yamijuan requested a review from MiltonLn November 25, 2020 19:59
@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 Natureshadow force-pushed the feature/related_views branch from 11e0d34 to 84c80f3 Compare January 5, 2021 13:01
@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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants