List Info

Thread: Best way to validate input?




Best way to validate input?
user name
2006-03-06 08:18:49
I may be responding too simplistically - if so forgive me


Extending your current scheme I would suggest you need ...

def MyPage1(self):
      return template_with_a_form_in_it
def doMyPage1(self, arg1, arg2, arg3):
	if validateOK() == True:
       		doProcessing()
	else:
		repopulateTemplateWithArgsAndErrorMsg
		return template_with_a_form_in_it

My personal preference is to combine MyPage1 and doMyPage1
but I can't
really think why just now.

One thing you might wish to consider is to ditch the named
args for
doMyPage1 and to use **kwargs as any decent sized form
produces a very
unpleasant number of arguments.

As I said perhaps I have not really answered your question -
if not
maybe you could clarify ?

thanks

richard.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )