跳至內容
選單
此問題已被標幟
1 回覆
1223 瀏覽次數

how to cancel that option when one field have 1 information in specific.


for example, if field1 = lalalala, the user cant duplicate the document

頭像
捨棄
最佳答案

Hi,

You can use constraints for this,

_sql_constraints = [
        ('name_uniq', 'UNIQUE (field_name)',  'The name must be unique !')
    ]


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
6月 25
1966
3
7月 25
3553
1
5月 25
1673
1
5月 25
1915
4
5月 25
3039