Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
31971 Lượt xem

Hi,i'm trying to make a unique field in my module but it doesn't work,i tried with _sql_constraints but i still add 2 records with the same cne

myfile.py

enter code here_columns = {

'cne':fields.char('Matricule', size=64,required=True), } _constraints = [('student_name','unique(cne)', 'cne already exists')]

Ảnh đại diện
Huỷ bỏ