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

Support Views in Flask-style decorators (RouteTableDef) #2472

Closed
socketpair opened this issue Nov 6, 2017 · 8 comments
Closed

Support Views in Flask-style decorators (RouteTableDef) #2472

socketpair opened this issue Nov 6, 2017 · 8 comments
Labels
Milestone

Comments

@socketpair
Copy link
Contributor

see #2471 (comment)

@asvetlov asvetlov added this to the 3.0 milestone Nov 7, 2017
@asvetlov asvetlov mentioned this issue Nov 7, 2017
@pfreixes
Copy link
Contributor

I was taking a look at that and looks hard to give a 100% of consistency between decorators and views. Likely the best way to give support for decorating views is creating a new ad-hoc method called view, see the following example:

routes = web.RouteTableDef()

@routes.view('/view')
class MyView(web.View):
    async def get(self):
        return await get_resp(self.request)

    async def post(self):
        return await post_resp(self.request)

Thoughts @asvetlov @socketpair?

@asvetlov
Copy link
Member

Brilliant idea.
Let's add web.view function and router.add_view() too -- in this case everything should interconnect smoothly.

@sheb
Copy link
Contributor

sheb commented Dec 14, 2017

Is anyone working on this ?

@asvetlov
Copy link
Member

AFAIK nobody.

@pfreixes
Copy link
Contributor

pfreixes commented Dec 14, 2017 via email

@sheb
Copy link
Contributor

sheb commented Dec 15, 2017

Ok I'll take care of it.
PR maybe this week-end

@asvetlov
Copy link
Member

Fixed by #2611

@lock
Copy link

lock bot commented Oct 28, 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].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

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

No branches or pull requests

4 participants