yes and no. It will not be enforced at the database level but if you
do not specify validators, it will use it to pick default validator
that enforce the uniqueness at the web2py level

On Sep 23, 11:17 am, Carl <[email protected]> wrote:
> My db.py includes...
>
> db.define_table('voucher',
>     Field('code', 'string', length=128, unique=True, notnull=True,
> required=True),
>     ....
>
> Locally on sqlite when I insert a second record with the same 'code'
> as an existing record insert() throws an except. I catch the exception
> and report back to the user.
>
> Locally on dev_appserver the "duplicate" insert() successfully inserts
> a duplicate record; no exception is thrown.
>
> I've looked at the 2nd edition book and this group but can't find
> anything that say that GAE doesn't support unqiue=True.
>
> Can anyone clarify this use of unique=True on GAE?
> And if it's not supported is there a recommended alternative approach?

Reply via email to