Not sure why you get an oracle error. The problem is that format must be a
string or a callack:
format='%(slug)s' #ok
format=lambda row: row.slug.upper() if slug else None # ok
format=IS_UPPER()('%(slug)s') # not ok because not a string
The syntax is IS_UPPER()(argument) funky but actually makes sense. This is
not a validator IS_UPPER. This is a validator IS_UPPER(). You are supposed
to do:
is_upper = IS_UPPER()
then use
requires = is_upper
You do not need one new object for each requires. Same with is_not_empty =
IS_NOT_EMPTY(). The validators must be instantiated at least once so they
can be configured. You can have multiple instances because you may need
different error messages in different places.
On Wednesday, 31 October 2012 19:46:26 UTC-5, Bill Thayer wrote:
>
> This is a tricky error to figure out so I am documenting it here
> <class 'cx_Oracle.DatabaseError'> ORA-00932: inconsistent datatypes:
> expected - got CLOB
>
> To get this error I had at the bottom of a table definition...
> ...
> auth.signature,
> format=IS_UPPER()('%(slug)s'),
> migrate=settings.migrate)
> Trying to make the slug display as uppercase.
> Should just be:
>
> auth.signature,
> format='%(slug)s',
> migrate=settings.migrate)
> Note: This is an *Oracle error*, the web2py book says the IS_UPPER()
> function never returns an error. Also note the funky syntax for
> IS_UPPER()(argument) is the same as IS_SLUG()(argument)
>
--