I want only one value stored per unique user, but using the `update_or_insert()` function is storing multiple values:
db.define_table(
'foo',
Field('haz', notnull=True, unique=True, requires=IS_IN_SET(['a', 'b', 'c'])),
Field('user_id', db.auth_user, unique=True)
)
db.foo.update_or_insert(haz='a', user_id=1)
db.foo.update_or_insert(haz='b', user_id=1)
db.foo.update_or_insert(haz='c', user_id=1)
It should only have one record at the end of this, with haz='c' and user_id=1. Instead, it provides 3 records.
How do I get this to work properly?
Thanks for all suggestions,
Alec Taylor