[Zope] Numeric Check

Diego Rodrigo Neufert diego@magicwebdesign.com.br
Thu, 3 Aug 2000 11:30:43 -0300


Thanks johan

Your trick about types worked!
Look:

try:
	fone_res = string.atoi(fone_res)
except ValueError:
	err = err + "ERR MSG"

On Thu, 03 Aug 2000, you wrote:
> I think extending the input-tag name with :float, :int, or :long and 
> test with type() from python would do the trick. 
> I havn't tested it but theoreticly it should work.
> 
> For more info on form field definitions check out Zen's
> How-To: Form Variable Types and Typechecking.
> 
> (I have used :tuple to submit a sequences of strings in a get request, e.g. url? varname:tuple=first_string&varname:tuple=second_string...)
> 
> //johan
> 
> 
> 
> 
> > Hi..
> > 
> > What's the best way to check if self.REQUEST.form.get('int_field') just contains
> > numeric data in a external method?
> > 
> > Thanks...
> > 
> > -- 
> > ---------------------------
> > Diego Rodrigo Neufert
> > -webmaster
> > ---------------------------
> > (Magic Web Design)
> > (email) (diego@magicwebdesign.com.br)
> > (curitiba) (pr)
> > 
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists - 
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> > 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
-- 
---------------------------
Diego Rodrigo Neufert
-webmaster
---------------------------
(Magic Web Design)
(email) (diego@magicwebdesign.com.br)
(curitiba) (pr)