I have tried unique in sql_constaints in OpenERP(Odoo) using two different methods using flower brackets {} or square brackets []. Both works fine. 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.')
]
P.S: But if I want to use more than a constraint it accepting only 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 behind it?