Closed Lynges closed 11 years ago
As FlaskView
classes are created automatically, i doubt you can customize __init__
signature.
Extension knows nothing about what argument you want to pass into.
Define model class as class attribute (can even be further customized via @property
feature).
P.S. For now FlaskClassy deals bad with inheritance. I advice you to be not bound with it for some time...
@ivan-kleshnin is correct.
Trying to create a subclass of FlaskView with a custom init like so:
gives this error:
Error disappears when custom init is removed. I am using this to set a model class on the view instance. This lets me create a basic REST interface that I can extend per model class, but the basic CRUD operations are defined here in the base class.