Hi !

Below given is a table ---
<code>
db.define_table('ac',
    Field('acnm','string', IS_LENGTH(100), length=100, required=True),
    Field('acgrpid', db.acgrp, notnull=True, required=True),
    Field('active', 'string', IS_LENGTH(1), length=1,
requires=IS_LENGHT(1), default='Y', required=True,  notnull=True),
    Field('homeunit', db.unit, notnull=True, required=True),
    Field('showall', 'string',IS_LENGTH(1), length=1,
requires=IS_LENGHT(1), default='Y', required=True,
    notnull=True),
    migrate=False
    )
</code>

--- In the Field 'active', I have written --- required=True,
notnull=True.
>From the documentation, the purpose of "required" is understood.
1) But where does "notnull" come in action? (whether in AJAX
validation or while DAL inserts or somewhere else).

2) For the Field 'active', I want to have a set of 2 values ('Y' &
'N').
In FORM, the user would be able to select a value from these 2 values
ONLY. (default is 'Y').
How do I do it?

Thanks,
Vineet

Reply via email to