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

register_route_param_type as decorator for Python Binds 🔥 #127

Closed
Ethosa opened this issue Sep 3, 2023 · 0 comments
Closed

register_route_param_type as decorator for Python Binds 🔥 #127

Ethosa opened this issue Sep 3, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request language bindings

Comments

@Ethosa
Copy link
Contributor

Ethosa commented Sep 3, 2023

@register_route_param_type("user", r"\d+")
class User:
    def __init__(self, data: str):
        identifier = int(data)
        self.load_from_db()
    
    def load_from_db(self):
        ...


@app.get("/user/id{user}")
def get_user(user: User):
    ...
@Ethosa Ethosa added enhancement New feature or request language bindings labels Sep 3, 2023
@Ethosa Ethosa self-assigned this Sep 3, 2023
@Ethosa Ethosa changed the title register_route_param_type as decorator for Python Binds🔥 register_route_param_type as decorator for Python Binds 🔥 Sep 3, 2023
Ethosa added a commit that referenced this issue Sep 3, 2023
@Ethosa Ethosa closed this as completed Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request language bindings
Projects
None yet
Development

No branches or pull requests

1 participant