On Thu, Apr 23, 2009 at 2:11 AM, Joe  Barnhart <joe.barnh...@gmail.com> wrote:
> I have a special application that holds the results of swimming
> matches.  I store all times as floating-point "seconds" internally,
> but I want to permit users to enter times as either a formatted string
> (mm:ss.hh) or an integer (mmsshh).
>
> I created my own custom validator which can take either input and
> renders the result to the database as a float.  It also formats the
> presentation to show the times as mm:ss.hh as the preferred output
> format.  So far, so good...
>
> Now the problem.  The underlying field is a 'double' which resolves to
> a float on Sqllite.  The built-in field validator for FLOAT is still
> active, so it prevents anyone from entering ":" characters.  Is there
> no easy way to completely replace the default field validator?  This
> will limit my use of the custom validation feature, I fear.

Default validators are in definition of function sqlhtml_validators,
in gluon/sql.py but I think it is not "normal" to a validator don't be
rewrited. Can you show your models and new validator code?

-- 
 Álvaro Justen
 Peta5 - Telecomunicações e Software Livre
 21 3021-6001 / 9898-0141
 http://www.peta5.com.br/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to