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

Route Model Binding #712

Open
1 task
Vringe opened this issue Sep 22, 2022 · 0 comments
Open
1 task

Route Model Binding #712

Vringe opened this issue Sep 22, 2022 · 0 comments

Comments

@Vringe
Copy link

Vringe commented Sep 22, 2022

Is your feature request related to a problem?

It would be very useful to have Route Model Binding, similar to what Laravel has.

What do we currently have to do now?

Currently, you have to retrieve the model by hand.

Describe the solution you'd like

Something like this:

routes/web.py:

Route.get('users/{user}', 'UserController@show')

app/controllers/UserController.py:

    from app.models.User import User
    def show(self, user: User):
        return user

Describe alternatives you've considered

No response

Would this be a breaking change ?

  • Yes

Anything else ?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant