-
Notifications
You must be signed in to change notification settings - Fork 68
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
Make auto-routes optional #16
Comments
I suppose the most explicit and least surprising way to handle this is probably an attribute that can be set to override automatic routing over the class object: class ClassyView(FlaskView):
auto_route = False
... |
I like that idea, but what I worry about is setting a future precedent where configuration values each get their own class attribute, and then the nightmare of having subclasses override that functionality as well. I guess the decision I have to make is:
|
(1) I think you can safely provide them each as an attribute and perhaps use a naming scheme where the attributes are named with a leading underscore. That would minimize the chance of unintended collisions. (2) The class that inherits |
I think, there MUST be a single point for switching auto-route on/off application-wide, making the implicit FlaskView successors' attribute value the same as that point says. For example it could be an app.config key. Then one could override that app-wide value for only those classes he wants. |
@joeshaw mentioned he'd like to see it be possible to disable automatically generating routes. We need to figure out the correct api for this feature, be it a keyword arg passed in during registration of the FlaskView or an attribute of the FlaskView itself.
The text was updated successfully, but these errors were encountered: