I am getting unexpected results using the IS_NOT_IN_DB validator and
also the unique=True validator. I have the following code:

Field('unique_id', type='integer', default=auth.user_id,
          label=T('Unique
ID'),readable=True,writable=False,unique=True)

db.bio.requires=IS_NOT_IN_DB(db, 'bio.unique_id')

The table is called bio. All I want to do is make sure that a user can
only post one entry in the bio table. I don't want a user to be able
to post multiple entries. A user should only be able to edit his or
her single original entry. But for some reason, even with the above
code, when I test I am able to create as many entries as I desire with
the same account. Is there an easier way to do this? Is there
something wrong with the way I am using the validator? I have it set
to readable=True and writable=False for testing purposes only.

Thanks in advance.

-Percy

Reply via email to