I have this in my model.
db.define_table('site',
    Field('location', 'string'),
    Field('user', db.auth_user, readable=False, writable=False),
    Field('typos', 'blob', readable=False, writable=False, default=None),
    Field('status', 'string', readable=False, writable=False, 
default='pending'),
    Field('last_scan', 'datetime', readable=False, writable=False, 
default=None)
)

db.site.status.requires = IS_IN_SET(['pending', 'working', 'done'])
db.site.location.requires = IS_URL()
I want it so that it validates that the combination of db.site.user and 
db.site.location are a unique value.  How do I do that in web2py?
I assume there is a way to do this in the model file and now in a 
controller with checks before insert.
BR,
Jason

-- 



Reply via email to