I tried unique in sql_constaints in OpenERP (Odoo) using two different methods using flower brackets {} or square brackets []. Both work great. Which one is correct?
_sql_constraints = { ('email_uniq', 'unique(email)', ' Please enter Unique Email id.') }
(or)
_sql_constraints = [ ('email_uniq', 'unique(email)', ' Please enter Unique Email id.') ]
PS: But if I want to use more than the restriction, it only accepts square brackets [] like this example.
_sql_constraints = [ ('email_uniq', 'unique(email)', ' Please enter Unique Email id.'), ('contact_uniq', 'unique(contact)', ' Please enter Unique Mobile no.') ]
What is the reason for this?
source share