Never mind. I think this is due to IS_HEX24 function.

On Feb 4, 10:39 am, vortex <[email protected]> wrote:
> I am setting a table column 'code' as Unique. When I insert repeated
> rows it doesn't raise exception.
>
> db.define_table('tag',
>     Field('code', 'string',   length=24, unique=True, requires=[
>         IS_HEX24(error_message=err_is_hex24)]),
>     Field('of_client',  'reference client', requires=IS_IN_DB(db,
> 'client.id', '%(name)s',        error_message=err_is_in_db),
> ondelete='SET NULL'),
>     Field('of_batch',   'reference batch', requires=IS_IN_DB(db,
> 'batch.id', '%(name)s',        error_message=err_is_in_db),
> ondelete='SET NULL'),
>     Field('active',     'boolean', default=True)
> )

Reply via email to