IS_NOT_IN_DB( ) exception error

閲覧: 18 回
最初の未読メッセージにスキップ

mostwanted

未読、
2021/12/09 0:37:252021/12/09
To: web2py-users
I'm trying to use the validator IS_NOT_IN_DB( ) but i keep getting the error below, what does it mean?

<type 'exceptions.Exception'> Validation error, field:policy_N <pydal.validators.IS_NOT_IN_DB object at 0x0000015E7996E940>

MY CODE:
db.define_table('client',
            Field('client_name'),
            Field('id_number', requires = IS_MATCH('^\d{9}?$', error_message='An ID Number should have exactly 9 digits')),

                Field('policy_N'),
                Field('date_of_birth', 'date'),
                Field('member_only', 'reference premium_for_member_only_family_policy'),
                format="%(client_name)s"
               )
db.client.policy_N.requires=IS_NOT_IN_DB(db,'db.client')

Jim S

未読、
2021/12/09 15:35:422021/12/09
To: web2py-users
Can you try this instead?

db.client.policy_N.requires=IS_NOT_IN_DB(db, 'client.id')

-Jim
全員に返信
投稿者に返信
転送
新着メール 0 件