1

I want to create some universal validation mechanism for all models using cerberus. The goal is to have cerberus schema in model's __schema__ property and perform validation of whole model using this schema each time model's state changed (not necessarily before insert or update). I thought about using events but I'm not sure how to do it and do not miss something.

Eugene Tsakh
  • 2,777
  • 2
  • 14
  • 27

1 Answers1

1

Based on what you're describing, you might be better off using marshmallow instead of cerberus:

http://marshmallow.readthedocs.io/en/latest/examples.html#quotes-api-flask-sqlalchemy

dizzyf
  • 3,263
  • 19
  • 29