Hello All,

The last time I wrote a mail to Python Tutors by pasting some of my
code, I was asked 'where is this kind of coding done?' ...

so I am back asking some thing pythonic on this list.

This is the value I am taking from the Form Field (with Jquery /
Autocomplete), but how do I validate / check to see if the value
entered in the Field is NOT NULL.


 state = form.getvalue('state')

html += '<tr><td>State :</td><td><center>' + str(state) + '</td></tr>'

The above 2 line are the actual code.


I tried If / else, did not work

if state == ' ' :
   return 'Please Enter the State Name'
else :
   return state

another trial was

         try:
           state = form.getvalue('state')
         except ValueError:
           'Please Enter the state Name'

Does not WORK.

I need to Check / Validate the data entered before inserting into DB.

Please guide.

Thanks

Nitin

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to