- Best way to input validation
Oops, excuse me for the incomplete message. Here is the correct one: Hi, I've just notice that I had a misconception about how Zope handle input data validation. I thought it were possible to handle the errors, but it looks like we are doomed to show to the user the python traceback. I believe now that the way to go is to forget the :int and :required specifiers in form attributes and directly code the validation code. Am I right? If so, then besides prototyping there's no use to these specifiers. Is there a best way to validate input form data? regards, -- Paulo Eduardo Neves PUC-Rio de Janeiro Pager: Central: 292-4499 cod. 213 99 64 ou use a URL: http://www.learn.fplf.org.br/neves/mensagempager.html
Paulo Eduardo Neves wrote:
Oops, excuse me for the incomplete message. Here is the correct one:
Hi,
I've just notice that I had a misconception about how Zope handle input data validation. I thought it were possible to handle the errors, but it looks like we are doomed to show to the user the python traceback.
I believe now that the way to go is to forget the :int and :required specifiers in form attributes and directly code the validation code. Am I right?
Sound's like it.
If so, then besides prototyping there's no use to these specifiers.
They are also useful if you don't want to bother writing validation code.
Is there a best way to validate input form data?
What would you like to do if an input is not valid? Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (888) 344-4332 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Jim Fulton wrote:
Paulo Eduardo Neves wrote:
Is there a best way to validate input form data?
What would you like to do if an input is not valid?
Probably show the same form and the completed data with an error message indicating why some fields were not valid. At least a message in portuguese, since most of my readers won't understand the english error message. I was thinking about coding a javascript library to validate the data in the client, but I'm convinced now that it isn't the way to go. If I use the "automatic" error handling feature I *can't* properly (from a usability view) handle it. Thanks for your answer Jim. -- Paulo Eduardo Neves PUC-Rio de Janeiro Pager: Central: 292-4499 cod. 213 99 64 ou use a URL: http://www.learn.fplf.org.br/neves/mensagempager.html
participants (2)
-
Jim Fulton -
Paulo Eduardo Neves