composite key in web2py
I have a table defined in web2py db.define_table( 'pairing', Field('user',writable=True,readable=True), Field('uid', writable=True , readable=True) ) This table needs to have user and uid combination being unique. I have looked through the web2py documentation , but there isn't direct way to define composite key . How do we define composite way in web2py It depends on what you are trying to do. By default, web2py automatically creates an auto-incrementing id field to serve as the primary key for each table, and that is the recommended approach whenever possible. If you are dealing with a