Skip to Content
Menu
This question has been flagged
1 Reply
2549 Views

hi,i have a form named "subject" for the student,,what i want is that user can not save duplicate or same subject name again and again,,for example if "english" is saved with its code it should not be saved again,,,how to do that??

Avatar
Discard
Best Answer

Hi,

Use _sql_constraints

_sql_constraints = [
        ('name_uniq', 'UNIQUE (name)',  'You can not have two users with the same name !')
    ]

Thanks & Regards

Avinash N K

Avatar
Discard