I just found out how to validate my database input before saving it, but I'm kinda bummed to find there are no premade rules (like validate email, length, etc) that are found in some web based frameworks. Are there any validation libraries laying around anywhere or somewhere that some premade validation lists are hiding that I haven't found yet?
Asked
Active
Viewed 1,098 times
1
-
SQLAlchemy isn't a web framework -- it's just ORM. What web framework ARE you talking about? Please list the specific products you're working with. – S.Lott Feb 17 '09 at 11:05
-
Well I'm not actually using a framework as of now. I'm using it with desktop Python. I was just comparing it to my past validation experiences using CodeIgniter. – ryeguy Feb 17 '09 at 14:00
1 Answers
3
Yes. There are. But keep your validation separate from your data layer. (As all the web frameworks do.)
Now the libraries you can use for validation are the exact form libraries from the web frameworks. Start with:
And a lot of others have sprung up recently, but most of them also deal with some degree of form generation. My personal favourite is WTForms.
On an interesting note, Formencode actually came from being the validation library for the (now) lesser-used SQLObject library, so it certainly has some traction and usage in this exact domain.

Ali Afshar
- 40,967
- 12
- 95
- 109