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 view instance for blueprint add_route method #424

Merged
merged 4 commits into from
Feb 14, 2017

Conversation

toughrogrammer
Copy link

  • make blueprint add_route method support view instance
  • update documentation that doesn't specify url_prefix parameter

growingdever and others added 2 commits February 14, 2017 14:23
- update documentation that doesn't specify url_prefix parameter
self.routes.append(route)
# Handle HTTPMethodView differently
if hasattr(handler, 'view_class'):
methods = frozenset(HTTP_METHODS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should a view default to having all methods defined? Maybe this should just be frozenset({'GET'})?

"""
Creates a blueprint route from a function.
:param handler: Function to handle uri request.
:param handler: Function or class instance to handle uri request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be more explicit? For example "Function for handling uri requests. Accepts function, or class instance with a view_class method."

growingdever added 2 commits February 14, 2017 17:15
@toughrogrammer
Copy link
Author

Thanks to your review. They are updated.

@seemethere seemethere added this to the 0.4.0 milestone Feb 14, 2017
@seemethere seemethere merged commit b139810 into sanic-org:master Feb 14, 2017
@sweetpotato0
Copy link

@seemethere When the release version?Our project use it!

@toughrogrammer toughrogrammer deleted the blueprint-support-view branch February 15, 2017 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants