Skip to content
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

Add a view to UrlDispatcher for iterating over all registered routes. #504

Closed
asvetlov opened this issue Sep 13, 2015 · 8 comments
Closed
Labels
Milestone

Comments

@asvetlov
Copy link
Member

Now the class has support for iterating over named routes only.
We should do the same for all routes (named+unnamed).

@asvetlov asvetlov added this to the 0.18 milestone Sep 19, 2015
@asvetlov asvetlov mentioned this issue Sep 22, 2015
@asvetlov asvetlov modified the milestones: 0.19, 0.18 Oct 19, 2015
@asvetlov
Copy link
Member Author

I'd like to have .named_routes() as well as .routes().
Any volunteer? The patch is very easy.

@asvetlov asvetlov added the good first issue Good for newcomers label Nov 4, 2015
@jashandeep-sohi
Copy link
Contributor

Should .named_routes() return a dict-like object or is a RoutesView sufficient?

@asvetlov
Copy link
Member Author

asvetlov commented Nov 4, 2015

It should return a read-only collections.abc.Mapping I guess.
Do you have another idea?

@jashandeep-sohi
Copy link
Contributor

types.MappingProxyType already implements a read-only interface over a mapping. So I think this should be enough:

def named_routes(self):
    return types.MappingProxyType(self._routes)

@asvetlov
Copy link
Member Author

asvetlov commented Nov 4, 2015

Wow! You are right.
Would you provide a PR with test and docs?

@jashandeep-sohi
Copy link
Contributor

Yes.

@asvetlov
Copy link
Member Author

asvetlov commented Nov 6, 2015

Fixed by #622

@asvetlov asvetlov closed this as completed Nov 6, 2015
@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants